datareader.getstring(0) error

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Nakhi

    #1

    datareader.getstring(0) error

    Hi,
    my code is very simple.

    dim cm as oledbcommand= new oledbcommand("s elect * from page " ,cn)
    cn.open()
    Dim dr As OleDbDataReader = cm.ExecuteReade r()
    dim cate=dr.getstri ng(1) 'error line"
    label1.text=cat e

    but there is error for dr.getstring(1) , the error reads:the data of this
    column does not exist:
    I am sure the second line exist(not null) and is string type.

    when add a read() before the error line,then there is no error. And in
    another sub, I can output the same datareader content using a do while
    read() function.

    Can anyone give me a hint?

    Nakhi
    From Lijinag,China.


Working...