try this on your Update Button Click
int i = 0;
int j = 0;
con = new OleDbConnection("YourConnectionString");
con.Open();
while (i < dataGridView1.Rows.Count)
{
string str = "update YourTableName set YourColumnName='" + dataGridView1.Rows[1].Cells[i].Value + "' where RommNo='" + dataGridView1.Rows[0].Cells[i].Value + "'";
cmd = new OleDbCommand(str(), con);
cmd.ExecuteNonQuery();
i += 1;
}
i = 0;
while (i < DataGridView1.Rows.Count)
{
str() = "update YourTableName set YourColumnName='" + dataGridView1.Rows[3].Cells[i].Value + "' where RommNo='" + dataGridView1.Rows[2].Cells[i].Value + "'";
cmd = new OleDbCommand(str(), con);
cmd.ExecuteNonQuery();
i += 1;
}