RSS Forums RSS
Please support our ASP.NET advertiser: Lunarpages ASP Web Hosting
Views: 1695 | Replies: 1
Reply
Join Date: Mar 2007
Posts: 5
Reputation: Windows3.11 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
Windows3.11 Windows3.11 is offline Offline
Newbie Poster

Bind data to controls (SQL)

  #1  
Mar 26th, 2007
I'm creating a web application in VB.NET 2003 that connects to a SQL database... how do I display the data in separate controls (TextBoxes, labels, etc) instead of in a data grid?

Thanks,
Windows 3.11
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jan 2006
Location: Its the internet... i am everywhere lol
Posts: 274
Reputation: f1 fan is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 11
f1 fan f1 fan is offline Offline
Posting Whiz in Training

Re: Bind data to controls (SQL)

  #2  
Mar 27th, 2007
my vb and my VS2003 are very rusty so there may be a better way than this.

You just get the record from the dataset/datatable and set the textbox.text or label.text = to the rows cell for the relevent data.

eg dim arow as datarow
textbox1.text = arow("firstname")
label1.text = arow("DOB")
etc and do the reverse to update the data.

You could always set the databinding on a text box and label and then put the textbox and labels datasource to the row and call databind on it too but i am rusty with VS2003 to know whether it is available in that or just 2005.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 4:29 am.
Newsletter Archive - Sitemap - Privacy Statement - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC