void shw_group() { try { s = "select * from create_group"; da = new OleDbDataAdapter(s, cn); DataSet ds = new DataSet(); da.Fill(ds, "set"); cmb_group_name.DataSource = ds; cmb_group_name.DisplayMember = "set.group"; } catch (Exception ea) { MessageBox.Show(ea.Message); } }
private void button1_Click(object sender, EventArgs e) { upd(); } void upd() { string group_name; group_name = cmb_group_name.Text; string s = "update persn_info set group ="+group_name+" where sub_no="+ txt_sub_no.Text; cm = new OleDbCommand(s, cn); //cm.Parameters.AddWithValue("@group", group_name); cn.Open(); cm.ExecuteNonQuery(); cn.Close(); MessageBox.Show("Subscriber information is updated", "Di-Count", MessageBoxButtons.OK, MessageBoxIcon.Information); }
cmb_group_name.DataSource = ds.Tables["set"];
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)