Textbox binding

H.A.C

New Member
Hi,<BR><BR>Just an ASP.Net newbie trying to learn it so my company can start providing the option as well as ASP and I've got a problem I can't seem to solve. The answer may be obvious but I'm not in the correct way of thinking.<BR><BR>I'm trying to do a simple "personal details" page, where users logged into my site can change their password/username etc. I can connect to the SQL server and pull the data from it with no problem. It's just a single row of data (eg. SELECT * FROM Users WHERE UserID = 2)<BR><BR>My theory was that I could place a couple of textboxes on the page and databind them in someway with the appropriate validation controls but I can't seem to find a way to databind just textboxes without a repeater or datagrid.<BR><BR>Am I thinking the right way or should I just be thinking to pull the data with Page_unload and then on the submission I do the validation and write to teh database?<BR><BR>Any help would be much appreciated. Also does anybody know if ASP.Net has a way to do a chat room or is a Java Applet still the best way?<BR><BR>WayneSo ur resulting dataset contains only one row. U can refer dataset(myDS) and get the 0 th row, n th item and bind to the relevant TextBox Server control with the below code. <BR><BR>Text1.Text = myDS.Tables("TableName").Rows(0).Item(n)<BR><BR> where n=0,1,2, .. upto bound table item counts <BR><BR>U can use the intrinsic validation controls without affecting the application.<BR><BR>KrishnanThanks,<BR><BR>Does this actually bind the data so that the '.update' command can be used? I was under the impression that a <%# ??? %> statment would have to be used as the textbox value.<BR><BR>Wayne
 
Back
Top