private void new_employee_data_Load(object sender, EventArgs e) { this.txt_new_employee_data_photo_name.Text = ""; db_connection ob = new db_connection(); string s = "select department from department"; this.comboBox1.DataSource = ob.rs(s).Tables[0]; comboBox1.ValueMember = "department"; }
private void button1_Click(object sender, EventArgs e) { ob = new db_connection(); string s = "insert into department(department) values('" + this.textBox1.Text + "')"; try { ob.iud(s); MessageBox.Show("Submitted"); } catch (Exception ex) { MessageBox.Show("Error" + ex.ToString()); } s = "select * from department"; this.dataGridView1.DataSource = ob.rs(s).Tables[0]; }