string new_val = new_value_txt.Text.ToString(); int rowindex = dataGridView3.CurrentCell.RowIndex; int row = dataGridView3.CurrentCell.RowIndex; string row_index_value = dataGridView3["ID", row].Value.ToString(); if (String.IsNullOrEmpty(new_value_txt.Text.Trim()) && String.IsNullOrEmpty(new_value_txt.Text.Trim())) { MessageBox.Show("Please Enter a New Value..", "Enter a Value", MessageBoxButtons.OKCancel); } OleDbCommand cmd = new OleDbCommand("update Purchases SET " + name_of_column + " ='" + new_val + "' WHERE " + name_of_column + " = '" + cellvalue + "' AND ID = '" + row_index_value + "' ", con); con.Open(); cmd.ExecuteNonQuery(); con.Close(); MessageBox.Show("updated Successfully!!");
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)