how can i connect conbobox to my SQL server database.
inder kumar
Hi, You can connect Combobox to SQLDB by using following code:- ComboBox.DataSource = objSqlDataset;ComboBox.DataTextField = "DisplayCol" // Column name which you want to display. ComboBox.DataValueField = "ValueCol"; // Column which you want to use for value.ComboBox.DataBind();
Hi,
You can connect Combobox to SQLDB by using following code:-
ComboBox.DataSource = objSqlDataset;ComboBox.DataTextField = "DisplayCol" // Column name which you want to display. ComboBox.DataValueField = "ValueCol"
Steps:1. Drag and drop the combo box2. If you see the dropdownlist in design mode, you can see the small greater than symbol, If you click on it you have a option like choose Datasource,3. Then you can connect to your database.