2
Reply

how can i connect conbobox to my SQL server database.

inder kumar

inder kumar

14y
5k
0
Reply

    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();


    Steps:
    1. Drag and drop the combo box
    2. 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.