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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top