Click here to Skip to main content
15,916,949 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: problem with programing Pin
Christian Graus6-May-09 13:42
protectorChristian Graus6-May-09 13:42 
QuestionProblem with Ajax :TabContainer Pin
jai_1016-May-09 5:17
jai_1016-May-09 5:17 
AnswerRe: Problem with Ajax :TabContainer Pin
Abhijit Jana6-May-09 9:48
professionalAbhijit Jana6-May-09 9:48 
GeneralRe: Problem with Ajax :TabContainer Pin
jai_1017-May-09 3:01
jai_1017-May-09 3:01 
QuestionReferencing an object in the code behind Pin
dptalt6-May-09 4:45
dptalt6-May-09 4:45 
AnswerRe: Referencing an object in the code behind Pin
Jeff Circeo6-May-09 12:23
Jeff Circeo6-May-09 12:23 
QuestionHow to get the values into the textbox using datareader in asp.net Pin
Anjani Poornima6-May-09 4:35
Anjani Poornima6-May-09 4:35 
AnswerRe: How to get the values into the textbox using datareader in asp.net Pin
Sujay chakraborty6-May-09 5:33
Sujay chakraborty6-May-09 5:33 
There could be few issues that u need to resolve for this code.

Firstly if you are having multiple rows in your database and you are trying to fetch those values in a single text box using DataReader then only the last record would be visible to you as the TextBox will be set to the last value only..... Secondly for using DataReader and SqlCommand you need an open connection so you need to specify an sqlconnection object and put it like

SqlConnection con = new SqlConnection();
con.Open();
sqlcommand com=new sqlcommand(query,con);
DataReader dr=com.ExecuteReader();
while(rdr.read())
{
textbox.text=rdr["fieldname"].getstring(); 
}
con.Close();

As DataReader is readonly and forward only so only the last value is available to the TextBox control. To avoid that and to retrieve all the values try some listbox or combobox. Best of luck!!!

Try hard but don't get stubborn
AnswerRe: How to get the values into the textbox using datareader in asp.net Pin
Abhijit Jana6-May-09 9:53
professionalAbhijit Jana6-May-09 9:53 
AnswerRe: How to get the values into the textbox using datareader in asp.net Pin
SayreCC6-May-09 15:04
SayreCC6-May-09 15:04 
QuestionHow to get the values into the textbox using datareader Pin
Anjani Poornima6-May-09 4:30
Anjani Poornima6-May-09 4:30 
AnswerRe: How to get the values into the textbox using datareader Pin
netJP12L6-May-09 4:36
netJP12L6-May-09 4:36 
AnswerRe: How to get the values into the textbox using datareader Pin
Abhijit Jana6-May-09 10:24
professionalAbhijit Jana6-May-09 10:24 
Questionproperties and methods Pin
netJP12L6-May-09 4:13
netJP12L6-May-09 4:13 
AnswerRe: properties and methods Pin
Jeff Circeo6-May-09 12:29
Jeff Circeo6-May-09 12:29 
QuestionCheckBoxList DataBinding on Postback [modified] Pin
Swetha Sankaran6-May-09 3:53
Swetha Sankaran6-May-09 3:53 
QuestionTimer Control in User control Pin
scothykonma6-May-09 3:28
scothykonma6-May-09 3:28 
AnswerRe: Timer Control in User control Pin
Jeff Circeo6-May-09 12:31
Jeff Circeo6-May-09 12:31 
QuestionLocalizing DateTime using microsoft report viewer [ RDLC ] Pin
vbexpert16-May-09 2:27
vbexpert16-May-09 2:27 
Questionbind textboxes runtime Pin
Sneha Bisht6-May-09 1:20
Sneha Bisht6-May-09 1:20 
AnswerRe: bind textboxes runtime Pin
Abhijit Jana6-May-09 2:03
professionalAbhijit Jana6-May-09 2:03 
Questiondomain check availability Pin
nithydurai6-May-09 1:12
nithydurai6-May-09 1:12 
AnswerRe: domain check availability Pin
Vimalsoft(Pty) Ltd6-May-09 1:18
professionalVimalsoft(Pty) Ltd6-May-09 1:18 
Questioncreate Windows Service Project in VS2005 & VS 2008??? Pin
nkmkrishna6-May-09 0:51
nkmkrishna6-May-09 0:51 
AnswerRe: create Windows Service Project in VS2005 & VS 2008??? Pin
Abhijit Jana6-May-09 1:01
professionalAbhijit Jana6-May-09 1:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.