I want to populate generic array(T[]) using ado.net.
Below is my generic array :
T[];
I dont want to use datatable as it is havier as compared to array or list and generic array in turnis lighter and faster than list.
My table structure is like below :
Id Amount
1 100
2 200
3 300
Moreover i dont want to fill datatable and then loop on to datatable and then filling my generic array.
I know i can use IdataReader
and then loop While(dr.read)
then fill my generic array.
I am looking for a way like how data adapter is directly filling datatable(da.fill(dt)
).
Is there any way to do this?