We're a community of 1076K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,075,659 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

linking database to the listbox

i want to select values from database.that values should be displayed in listbox.

<Thanks in Advance >

3
Contributors
2
Replies
1 Hour
Discussion Span
2 Months Ago
Last Updated
13
Views
mohan564
Newbie Poster
1 post since Feb 2013
Reputation Points: 0
Solved Threads: 0
Skill Endorsements: 0

No clarity in your question. In which way do u want to retrieve data from database. If you know how to retrieve data from database as a table. Then simply write the below code.

listbox.DataSource = data;//Your data table from database
listbox.DataTextField = "FieldName";//The name of the column in the data table to set text(which is visible)
listbox.DataValueField = "FieldID";//The name of the column in the data table to set value.
listbox.DataBind();// To bind data.
Munnazz
Light Poster
38 posts since Dec 2010
Reputation Points: 10
Solved Threads: 6
Skill Endorsements: 0

Please show some attempt to solve this yourself. We can answer specific queries, but we aren't really into doing other peoples work/assignments/coursework for them, especially when they put no effort in themselves.

Ketsuekiame
Veteran Poster
1,193 posts since May 2010
Reputation Points: 541
Solved Threads: 153
Skill Endorsements: 8

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page rendered in 0.0597 seconds using 2.7MB