As you can see from the code, I called the Find method to find the row and called the Delete method of the Data Row.
One Button is for deleting the selected row and other one is for updating or inserting new row. When i click update button i got this exception can u tell me why??? i am using form1 obj=new form1(); obj.refresh(); but it is not work…. Now, when you close the add data form, open the datagrid form again automatically.
You can avoid building Command objects manually by using Command Builder.
As you saw in the Data Table, Data Row, and Data Column sections at the beginning of this article, you can use the Delete method of a Data Row to delete a row.
Note: Keep in mind that this Update is different than a SQL UPDATE statement.