Expand|Select|Wrap|Line Numbers
- string[] myArray;
Expand|Select|Wrap|Line Numbers
- int Index;
{
SqlCommand getCar = new SqlCommand("select Car from myTable where carID = '"+ 3 +"' ", myConnection);[/code]
[code]myCar = getCar.ExecuteNoneQuery();
Index ++;
myArray = new string[Index];
MyArray[Index] = myCar.ToString();
}
The array obviously gets all it's indexes but only the last index in the array has the value of myCar and the rest is null.
The reason is because I'm declaring the array over and over each time with the new keyword.
How can I keep all the 'myCars' in the Array everytime the array's index grows?
Your Help would be appreciated