I made simple project where it show a table (that i previously made in
MS SQL).
When i start the project and i add a row, clicking the save button all
work. But if i want to cancel the full row, the cancel button does not
perform the job, practically nothing happens. The code behind the
cancel_button click event is:
private void BtnCancel_Click(object sender, EventArgs e)
{
this.CMSDataSet1.tbl_worker.Clear();
this.tbl_workerTableAdapter.Fill(this.CMSDataSet1.tbl_worker);
}
Thanks
Matteo Migliore - 17 Sep 2007 01:31 GMT
> I made simple project where it show a table (that i previously made in
> MS SQL).
>
> When i start the project and i add a row, clicking the save button all
> work. But if i want to cancel the full row, the cancel button does not
> perform the job, practically nothing happens.
It's not clear: do you want to delere a row of the DataTable?
Here's the code:
------------------------
DataRow rowDel=ds.Tables[TBL_NAME].Rows[2];
rowDel.Delete();
ds.Tables[TBL_NAME]. AcceptChanges();
sqlAdap.Update(ds.Tables[TBL_NAME]);
------------------------
Matteo Migliore.