Is there a way to convert SqlDataReader to arrayList?
I have to pass the results of a query from one page to another so that I can then bind it to a gridview. However, I can't pass the SqlDataReader object in the session.
How can I achieve the following?:
if (rdr.HasRows == true)
{
while (rdr.Read())
{
arraylist.add(whole row); //pseudo code
}
}
Thank you :)
DataTablewith aSqlDataAdapterand use that asDataSource.ArrayListrather than aList<T>?