can't getstring & display datareader

Discussion in 'ASP .Net' started by Nakhi, Jul 15, 2003.

  1. Nakhi

    Nakhi Guest

    Hi,
    I want to display a single record datareader and get a value from it. But I
    can't do both together.

    After "dim dr as Oledbdatareader=cmCat.ExecuteReader()", the following is
    OK(display this single record):
    repPage.datasource=dr
    repPage.databind
    The following is OK(retriving value):
    dr.read()
    dim thiscat=dr.getstring(1)
    But the following is error:
    repPage.datasource=dr
    repPage.databind
    dr.read()
    dim thiscat=dr.getstring(1)

    Is that after binding,the cursor is at the next after last row, and I can't
    get the first row(the only row)?

    How can I do both together? Can any one give me a hit?

    Thanx
    Nakhi
    Lijiang,Yunnan,China,Asia
    Nakhi, Jul 15, 2003
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Nakhi

    datareader.getstring(0) error

    Nakhi, Jul 14, 2003, in forum: ASP .Net
    Replies:
    3
    Views:
    2,119
    Nakhi
    Jul 15, 2003
  2. iMonkey

    encoder.GetString() help

    iMonkey, Jul 31, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    425
    iMonkey
    Jul 31, 2003
  3. DaveF

    GetString for .net

    DaveF, Jun 11, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    1,619
    John Saunders
    Jun 11, 2004
  4. =?Utf-8?B?TGVlIFdhbHRlcnM=?=

    Find size of GetString in DataReader (vb.net)

    =?Utf-8?B?TGVlIFdhbHRlcnM=?=, Dec 27, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    5,032
    =?Utf-8?B?TGVlIFdhbHRlcnM=?=
    Jan 4, 2005
  5. Colin Steadman

    Can we use script in a table if GetString is used?

    Colin Steadman, Feb 10, 2004, in forum: ASP General
    Replies:
    3
    Views:
    107
    Colin Steadman
    Feb 11, 2004
Loading...

Share This Page