Arrays and datareader...going insane

  • Thread starter Thread starter Michael Lehde
  • Start date Start date
M

Michael Lehde

I need to pull about 10 columns out of one SQL table and dump them into a
usable array. 1 array vs. 10 variables will really make my job easier, as
well as cut down on calls to the server. They are all varchar types, but
seeing the fact I have to use an object array to pull it out with
datareader, I can't call out anything as a string. Any clues?
 
Hi Michael,

If you can get your 10 columns into an ArrayList (eg alObjCols) then you
can create an array of strings.

Dim asStrCols() As String = DirectCast _
(alObjCols.ToArray (GetType (String)), String())

which looks horrible, perhaps, but does the job.

Regards,
Fergus
 
Back
Top