1,105,332 Community Members

linking database to the listbox

mohan564
Newbie Poster
1 post since Feb 2013
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
Unverified Member
 
0
 

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

<Thanks in Advance >

Member Avatar
Munnazz
Light Poster
37 posts since Dec 2010
Reputation Points: 0 [?]
Q&As Helped to Solve: 6 [?]
Skill Endorsements: 0 [?]
 
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.
Member Avatar
Ketsuekiame
Posting Virtuoso
1,674 posts since May 2010
Reputation Points: 793 [?]
Q&As Helped to Solve: 231 [?]
Skill Endorsements: 24 [?]
 
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.

You
This article has been dead for over three months: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: