Click here to Skip to main content
15,891,951 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How we can Bind a dropdown with a table column values,
in my table i have 3 columns, in that 2nd column i have to bind with my ddl,
i get the table in dataset after that how i bind the 2nd col with ddl,
if u know help me..
Posted

Try:
C#
myDropdown.Datasource = myDataset.Tables["myTable"];
myDropdown.DataValueField = "column2";
myDropdown.DataTextField = "column2";
myDropdown.Databind();
 
Share this answer
 
Hi,


To bind dropdown you have to set Dropdown's DataTextField and DataValueField properties. Just give a your table column name into that property.
 
Share this answer
 

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