sqlAdapter =
new
SqlDataAdapter(
"SELECT *, 'Delete' AS [Delete] FROM Employees"
, sqlCon);
else if (Task == "Update") { int r = e.RowIndex; dataset.Tables["empdt"].Rows[r]["eid"] = dgvEmployee.Rows[r].Cells["eid"].Value; dataset.Tables["empdt"].Rows[r]["ename"] = dgvEmployee.Rows[r].Cells["ename"].Value; dataset.Tables["Employees"].Rows[r]["Title"] = dgvEmployee.Rows[r].Cells["Title"].Value; dataset.Tables["empdt"].Rows[r]["eage"] = dgvEmployee.Rows[r].Cells["eage"].Value; dataset.Tables["empdt"].Rows[r]["esalary"] = dgvEmployee.Rows[r].Cells["esalary"].Value; sqlAdapter.Update(dataset, "Employees"); dgvEmployee.Rows[e.RowIndex].Cells[6].Value = "Delete"; } }
catch
(Exception ex) {}