ADO Getchanges() method doesnt show deleted?

T

trinitypete

Hi all,

I have a datagrid bound to a dataset containing 1 table
(DataSet1). I have another datagrid that is bound to a
datatable which is created on the Rowchanging event of the
table in DataSet1.

The datatable is created in the following way:

DataTable mychanged = new DataTable();
mychanged = mydata.Tables["Table1"].GetChanges();
dataGrid5.DataSource = mychanged;

Now if I delete a row in the first datagrid, the row
changing event of the table in DataSet1 fires, which as
far as I can see should create the Datatable which
contains 1 row - the deleted row, but nothing ends up in
the datatable. I have alsio tried a similar thing using
dataset.getchanges but with the same results.

Datatable.HasChanges returns true?

Thanks in advance - Pete
 
P

Pete Wright

You got it ;)


--
Peter Wright
Author of ADO.NET Novice To Pro, from Apress Inc.


_____________________________
trinitypete said:
Think I have got it. Deleted rows can not be displayed in
a datagrid without using a dataview.

Pete.
-----Original Message-----
Hi all,

I have a datagrid bound to a dataset containing 1 table
(DataSet1). I have another datagrid that is bound to a
datatable which is created on the Rowchanging event of the
table in DataSet1.

The datatable is created in the following way:

DataTable mychanged = new DataTable();
mychanged = mydata.Tables["Table1"].GetChanges();
dataGrid5.DataSource = mychanged;

Now if I delete a row in the first datagrid, the row
changing event of the table in DataSet1 fires, which as
far as I can see should create the Datatable which
contains 1 row - the deleted row, but nothing ends up in
the datatable. I have alsio tried a similar thing using
dataset.getchanges but with the same results.

Datatable.HasChanges returns true?

Thanks in advance - Pete



.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top