Hey All,
I have question about the best way to go about doint this:
SqlDataReader _dr=components.getItems();
fooclass _myarray = new fooclass[5]; //create new array of my class
int i=0;
while (_dr.Read()) //loop through data reader to add items to the array
{
_myarray[i]=new myarray();
_myarray[i].title=_dr["sometitle"].ToString();
_myarray[i].description=_dr["somedescription"].ToString();
i++;
}
_dr.Close();
Since I don't know how large the datareader will be until I loop through it
what is the best way to manage the size of this array? Is it most efficient
to check if the my array is full and the allocate another N spaces in it?
Thanks alot,
-a newb trying to improve