string constring = "datasource=127.0.0.1;username=root;password=admin"; string Query = "select * from mohamed.usercompany1 where office = '" + textBox1.Text + "' ;"; MySqlConnection conDataBase = new MySqlConnection(constring); MySqlCommand cmdDataBase = new MySqlCommand(Query, conDataBase); DataSet DataSet1 = new DataSet(); MySqlDataReader myReader; try { conDataBase.Open(); myReader = cmdDataBase.ExecuteReader(); if (myReader.Read()) { string scode = myReader.GetInt32("techname").ToString(); textBox1.Text = (string)myReader["techname"]; comboBox2.Items.Add(scode).ToString(); listView1.Items.Add(scode).ToString(); this.Refresh(); } } catch (Exception ex) { MessageBox.Show(ex.Message); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)