DataReader to ArrayList

  • Thread starter Thread starter A.M
  • Start date Start date
A

A.M

Hi,

What would be the fastest way to transfer a one column DataReader into a
ArrayList ?

Thanks,
Alan
 
Thanks for reply,
I was thinking that there are integration between intrfaces, so instead of
creating a loop, we can use methods doing that.

Is it the same with DataSet (only method to copy is creating a loop) ?

Alan




William Ryan eMVP said:
while(rdr.Read()){
myArrayList.Items.Add[rdr.Getxxxx[0]);
}
A.M said:
Hi,

What would be the fastest way to transfer a one column DataReader into a
ArrayList ?

Thanks,
Alan
 
Not in a reader... it only works when connected...


A.M said:
Thanks for reply,
I was thinking that there are integration between intrfaces, so instead of
creating a loop, we can use methods doing that.

Is it the same with DataSet (only method to copy is creating a loop) ?

Alan




William Ryan eMVP said:
while(rdr.Read()){
myArrayList.Items.Add[rdr.Getxxxx[0]);
}
A.M said:
Hi,

What would be the fastest way to transfer a one column DataReader into a
ArrayList ?

Thanks,
Alan
 
Sorry about that, I hit send by accident. Anyway, depending on how the
reader is structured you can use GetValues of the reader. Datasets/tables
are structured differently b/c you don't have to move forward through it. A
datatable you can access anyway you like. There's a method for instance,
GetItemArray of the datarow that can accomplish this for you
A.M said:
Thanks for reply,
I was thinking that there are integration between intrfaces, so instead of
creating a loop, we can use methods doing that.

Is it the same with DataSet (only method to copy is creating a loop) ?

Alan




William Ryan eMVP said:
while(rdr.Read()){
myArrayList.Items.Add[rdr.Getxxxx[0]);
}
A.M said:
Hi,

What would be the fastest way to transfer a one column DataReader into a
ArrayList ?

Thanks,
Alan
 
Back
Top