Click here to Skip to main content
15,887,683 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
how to bind drop down with database in .net c# desktop application
Posted

 
Share this answer
 
Comments
Bama Boy 5-Oct-13 6:50am    
thnx
[no name] 5-Oct-13 7:30am    
Welcome
 
Share this answer
 
Comments
Bama Boy 5-Oct-13 6:51am    
thnx
[no name] 5-Oct-13 7:12am    
Glad to help..
DataTable dataTable = GetDataTable("Select * from Student"); // You have to implement the ways to retrieve data from the database.
comboBox1.Datasource = dataTable;
comboBox1.DisplayMember = StudentName; // Column Name
comboBox1.ValueMember = StuentId; // Column Name
 
Share this answer
 
Comments
Bama Boy 5-Oct-13 6:51am    
thnx

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900