Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. How to get the values into the textbox using datareader

How to get the values into the textbox using datareader

Scheduled Pinned Locked Moved ASP.NET
csharpdatabasecomhelptutorial
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Anjani Poornima
    wrote on last edited by
    #1

    hi, i am very new to this .net world I like to get the values into the textbox using datareader. I tried in this way : sqlcommand com=new sqlcommand(query,connectionstring) sqldatareader rdr=com.executereader(); while(rdr.read()) { textbox.text=rdr["fieldname"].tostring(); } but i am not getting the values into the textbox. plz help me by posting the code....... Thanx in advance :)

    N A 2 Replies Last reply
    0
    • A Anjani Poornima

      hi, i am very new to this .net world I like to get the values into the textbox using datareader. I tried in this way : sqlcommand com=new sqlcommand(query,connectionstring) sqldatareader rdr=com.executereader(); while(rdr.read()) { textbox.text=rdr["fieldname"].tostring(); } but i am not getting the values into the textbox. plz help me by posting the code....... Thanx in advance :)

      N Offline
      N Offline
      netJP12L
      wrote on last edited by
      #2

      double the column name, check if you have value for that field in the database. check if you are even getting any rows. Also check if you are even coming into the while loop function let's say for instance. while(dr.Read() { textbox.Text="I am here";///so at least you know some rows are being returned. }

      1 Reply Last reply
      0
      • A Anjani Poornima

        hi, i am very new to this .net world I like to get the values into the textbox using datareader. I tried in this way : sqlcommand com=new sqlcommand(query,connectionstring) sqldatareader rdr=com.executereader(); while(rdr.read()) { textbox.text=rdr["fieldname"].tostring(); } but i am not getting the values into the textbox. plz help me by posting the code....... Thanx in advance :)

        A Offline
        A Offline
        Abhijit Jana
        wrote on last edited by
        #3

        Asking same question multiple times does not help you get better answer. :)

        cheers, Abhijit CodeProject MVP Web Site:abhijitjana.net

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups