Control Panel
Forum
Hosting Help
6 Months free Hosting (New!)
Resources
Login
Members
Shared Hosting
|
New Features
|
Advertise
|
Tutorials
|
Product Reviews in India
|
Free aptitude test questions
|
TATA Nano Car reviews
Total
members
:
80998
Average new registrations per day (in last 7 days):
41
New Registration:
Open
Register Now
Home
»
Resources
»
Quick dropdown data binding
ASP.NET
ADO.NET
Web Services
Remoting
Visual Studio 2005
Error Bank
Interview Questions
Tips & Tricks
XML
HTML
Jscript/Javascript
IIS
Windows
General
Submit Resource or code snippet
... and get
surprise gifts
Win Digital camera, ASP.NET Books, Free softwares!!
Quick dropdown data binding
19 Apr, 2008
Author:
Phil Phan
Summary
A fast and easy way to bind data to your dropdowns from a sql server or MS Access table
.NET Classes used :
1. Select your dropdown in the Design tab
2. Right Click and select properties
3. Find DataSourceID property and select "New Data Source"
4. You will now see a wizard popup that will guide you through setting up a data source
5. Create a Database or Access data source
6. Select your connection string
7. Select the table you want bound to your dropdown
8. Select columns you want as part of your data source, be sure to include the value of the dropdown and the display value of the dropdown
9. Click Finished
10. Now you need to set up which column from your data source you want as the display value and which column you want as the value/ID. Right click and go to properties of the dropdown again.
11. Set property "DataTextField" to the column name you want as your display value from your data source
12. Set "DataValueField" to the column name you want as your value/id from your data source.
Done! you've now done a quick databind to a dropdown straight from your database table!
If you have any questions please feel free to message or e-mail me.
Feedbacks about this page from members:
- No Feedbacks yet !! -
Submit Feedback
View All Feedbacks
Partners
Privacy Policy
Terms of use
Contact Us
SpiderWorks Technologies.
All Rights Reserved.