|
Combobox does not count drop-down box, this is in WinForm ...
for example:
SqlConnection con = new SqlConnection ("server = .; database = student; uid = sa; pwd = 0421");
SqlDataAdapter sda = new SqlDataAdapter ("select * from studentDetails", con);
DataSet ds = new DataSet ();
sda.Fill (ds, "student");
this.ComboBox1.DataSource = ds.Tables ["student"];
this.ComboBox1.DisplayMember = "sname";
// If it is a WebForm, you can use the DropDownList said by some upstairs .. |
|