DataReader

Discussion in 'ASP .Net' started by patrick, May 13, 2006.

  1. patrick

    patrick Guest

    newbie-question

    i have a table with 2 rows and 4 columns. i'm using a datareader for
    performance reason. now i would like to assign to a textfield a value from
    this datareader, i.e

    if value in record1/field1 = bla then
    textfield.text = row1.field4
    end if

    how can i do this?
     
    patrick, May 13, 2006
    #1
    1. Advertising

  2. patrick

    PeterKellner Guest

    "patrick" <> wrote in message
    news:...
    > newbie-question
    >
    > i have a table with 2 rows and 4 columns. i'm using a datareader for
    > performance reason. now i would like to assign to a textfield a value from
    > this datareader, i.e
    >
    > if value in record1/field1 = bla then
    > textfield.text = row1.field4
    > end if
    >
    > how can i do this?
    >


    Here is some example code.
    while (sqlDataReader.Read())

    {

    textfield.text = sqlDataReader.IsDBNull(0) ? string.empty :
    sqlDataReader.GetString(0);

    }
     
    PeterKellner, May 14, 2006
    #2
    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. Derek LaZard

    Re: Abt Datareader Count

    Derek LaZard, Jul 8, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    1,747
    Derek LaZard
    Jul 8, 2003
  2. Replies:
    1
    Views:
    1,540
  3. Replies:
    0
    Views:
    439
  4. Replies:
    0
    Views:
    421
  5. James Brown
    Replies:
    1
    Views:
    5,434
    bruce barker
    Jun 26, 2003
Loading...

Share This Page