C
Clinton Daniel
I have an array like this:
MyClass[] myArray;
In a method I allocate it depending on how many rows in the DataTable:
myArray = new MyClass[myDataTable.Rows.Count
However, when I try to access them in a foreach loop, they aren't instantiated.
foreach(MyClass tmpClass in myArray)
{
tmpClass.myField = 1; // set to 1 as a test
}
WTF is going wrong?
MyClass[] myArray;
In a method I allocate it depending on how many rows in the DataTable:
myArray = new MyClass[myDataTable.Rows.Count
However, when I try to access them in a foreach loop, they aren't instantiated.
foreach(MyClass tmpClass in myArray)
{
tmpClass.myField = 1; // set to 1 as a test
}
WTF is going wrong?