i tried many things . but still am not able to find the solution how to delete the selected row from the datagridview in a window application and saving the changes to the database.
still waiting for the reply..........
Still looking for removing row from datagridview in window application.
4 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Mamta MRank #268 · 9.4K reputationPosted Jul 21, 2010, 10:43 PM EDT
-Mamta
Posted Jul 22, 2010, 1:18 AM EDT
please tell me the whole code.
Mamta MRank #268 · 9.4K reputationPosted Jul 22, 2010, 2:17 AM EDT
private void datagvw_UserDeletingRow(object sender, DataGridViewRowCancelEventArgs e)
{
int i = e.Row.Index;
tableadapter.Adapter.DeleteCommand = new SqlCommand("Delete from Products where ProductCode=" + ds.Books.Rows[i][0], tableadapter.Connection);
tableadapter.Adapter.DeleteCommand.ExecuteNonQuery();
}
Sam HobbsRank #107 · 20.5K reputationPosted Jul 22, 2010, 8:00 PM EDT
Another possibility is my article Database Table Update in a DataGridView without Writing Code.