private void button1_Click(object sender, EventArgs e) { CreateDataTable(); multiColumnComboBox1.Table = dtable; multiColumnComboBox1.DisplayMember = "DoctorName"; multiColumnComboBox1.ColumnsToDisplay = new string[] { "DoctorID", "DoctorName" }; button1.Enabled = false; } private void CreateDataTable() { dtable = new DataTable("Rock"); //set columns names dtable.Columns.Add("Doctor ID", typeof(System.String)); dtable.Columns.Add("Doctor Name", typeof(System.String)); con.Open(); SqlDataAdapter da = new SqlDataAdapter("SELECT DoctorID, DoctorName FROM DoctorTabl", con); dataset = new DataSet(); da.Fill(dataset, "DoctorTabl"); dtable = dataset.Tables["DoctorTabl"]; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)