SqlConnection conn = new SqlConnection("Data Source=HP\\SASI;Initial Catalog = test;Integrated Security=SSPI;"); conn.Open(); SqlCommand cmd = new SqlCommand(); string query = "Select fn+''+ln from user_details where category='Doctor'";// position column from position table cmd.Connection = conn; cmd.CommandText = query; SqlDataReader dr = cmd.ExecuteReader(); while (dr.Read()) { string myItem = dr[0].ToString(); comboBox1.Items.Add(myItem); } conn.Close(); SqlConnection conn1 = new SqlConnection("Data Source=HP\\SASI;Initial Catalog = test;Integrated Security=SSPI;"); conn1.Open(); SqlCommand cmd1 = new SqlCommand("select firstname+''+lastname from patient_table",conn1); SqlDataReader dr1 = cmd1.ExecuteReader(); while (dr1.Read()) { string name = dr[0].ToString(); comboBox1.Items.Add(name); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)