I am using SQl data reader to get value from SQL database.
Language VB.NET
After getting data into reader, i run a while loop
While reader.Read
If reader.HasRows() Then
/* Proessing of data */
End If
End While
I observe that the while loop takes a lot of time to process as there are many rows. Is there any better way to implement.
Please comment on: Should i get the SQlDataReader data into arraylists, and then process data using the arraylists?
Algo:
While reader.read
/* Put data into Arraylists */
End While
for(arraylist row count)
/*Process data*/
end for
ArrayList(you should also consider using generics instead ofArrayList) then doing the processing on them is guaranteed to be slower. Is there a reason you can't page the data you're returning?