private void panel4_Click(object sender, EventArgs e) { try { OleDbDataAdapter adpt = new OleDbDataAdapter("select Stu_name as 'Name' ,Stu_class as 'Class',Stu_roll as 'Roll Number',Stu_section as 'Section',Attendence from EnrollStud where Stu_class='" + comboBox3.SelectedItem + "' and Stu_section='" + comboBox4.SelectedItem + "'", conn); conn.Open(); OleDbCommandBuilder cdb = new OleDbCommandBuilder(adpt); adpt.Fill(ds); adpt.Fill(dt); ds.Tables[0]; a = dt.Rows.Count; if (dt.Rows.Count.Equals(0)) { MessageBox.Show("Sorry!Please Select Correct Class and section"); } else { dataGridView1.DataSource =dt; } conn.Close(); } on save button click i want to update changes of gridview into acess database private void button1_Click(object sender, EventArgs e) { try { if (dataGridView1.Rows.Count.Equals(0)) { MessageBox.Show("select some data!!","message",MessageBoxButtons.OK,MessageBoxIcon.Stop); } else { adpt.Update(dt); MessageBox.Show("Record is updated", "message", MessageBoxButtons.OK, MessageBoxIcon.Information); } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } } I am using acess2003 as database
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)