datareader question

  • Thread starter Thread starter Agnes
  • Start date Start date
A

Agnes

i will select over 30 fieldsname from myTable.
If i use datareader, my way to get the result is (loop - the datareader)
and strResult = myReader.getstring(12) .
Can I use the itemname to get the result ??/
Thanks
 
Reader.Item("Column_name")

Or

Reader("Column_name")

Don't think there's any differance really.. depends on what you think its
easier to read I guess!

But When you use GetString.. you can't really use the columnnames and you
are stuck with typing the ColumnIndex.. and sometimes that's bad if you
would to change the number or order of columns in the database..

/Lars Netzel
 
Hi,

strResult = myReader.item("MyField").tostring

Ken
----------------------

i will select over 30 fieldsname from myTable.
If i use datareader, my way to get the result is (loop - the datareader)
and strResult = myReader.getstring(12) .
Can I use the itemname to get the result ??/
Thanks
 
Hi Agnes,
i will select over 30 fieldsname from myTable.

In this kind of operations I create first a table of names and use that in a
loop or loops

I hope this helps?

Cor
 

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