string constr = @"Data Source=192.168.*.*; Database=wsditsupport; User ID=**; Password=**"; public Form7() { InitializeComponent(); MySqlConnection cn = new MySqlConnection(constr); string value = "SELECT passover_info FROM probing_production"; MySqlDataAdapter adp = new MySqlDataAdapter(value, cn); DataTable dt = new DataTable(); adp.Fill(dt); comboBox1.DataSource = dt; comboBox1.DisplayMember = "passover_info"; cn.Close(); } private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) { if (comboBox1.SelectedIndex == -1) { textBox1.Text = string.Empty; } else { textBox1.Text = comboBox1.SelectedItem.ToString(); } } }
else { textBox1.Text = ((DataRowView)comboBox1.SelectedItem)["passover_info"].ToString(); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)