How to get the values into the textbox using datareader
-
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 :)
-
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 :)
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. }
-
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 :)
Asking same question multiple times does not help you get better answer. :)
cheers, Abhijit CodeProject MVP Web Site:abhijitjana.net