I want to delete records from database in datagridview on window form app.
here is my code
System.Data.SqlClient.SqlCommandBuilder cb2;
cb2 = new System.Data.SqlClient.SqlCommandBuilder(da);
DataTable dt2 = ds.Tables["Employee"];
dt.PrimaryKey = new DataColumn[] { dt.Columns["EmpID"] };
dtDelete.Delete();
da.Update(ds, "Employee");
MessageBox.Show("Record Deleted");
int inc = 0;
int maxRow = 0;
maxRow = ds.Tables["tblImpi"].Rows.Count;
ds.Tables["tblImpi"].Rows[inc].Delete();
Update();
inc--;
// NavigateRecords();