You have not instantiated itemname
. You need to do this (3 is just a random number):
public static string[] itemname = new string[3];
If you didn’t do this, you should have received the error on this line:
itemname[id] = "foo";
More Related Contents:
- What is the difference between a reference type and value type in c#?
- ArrayList vs List in C#
- Reading a C/C++ data structure in C# from a byte array
- Is there an easy way to check the .NET Framework version?
- Where is the Application.DoEvents() in WPF?
- Multi-threaded splash screen in C#?
- What’s the difference between System.ValueTuple and System.Tuple?
- Which Radio button in the group is checked?
- Searching a tree using LINQ
- Logging request/response messages when using HttpClient
- How can I test for the presence of an Action Filter with constructor arguments?
- How to get the z-order in windows?
- What’s the best way to calculate the size of a directory in .NET?
- Hosting CLR in Delphi with/without JCL – example
- Gracefully handling corrupted state exceptions
- Taking screenshot of a webpage programmatically [closed]
- Using System.IO.Packaging to generate a ZIP file
- Where is HttpContent.ReadAsAsync?
- Transparent window layer that is click-through and always stays on top
- Patterns for Compensating Lack of Inheritance in SOA
- how to compare string with enum in C#
- file write permission issue under “Program Files” folder
- Should I always disconnect event handlers in the Dispose method?
- TargetedPatchingOptOut: “Performance critical to inline across NGen image boundaries”?
- using statement FileStream and / or StreamReader – Visual Studio 2012 Warnings
- Dynamically creating a proxy class
- Connection to Office 365 by EWS API
- CanExecuteChanged event of ICommand
- Make a BackgroundWorker do several operations sequentially without freezing the form
- Is int? thread safe?