M
mozek
Hi,
can anyone help me with the following trouble?
PROBLEM:
There is no row with RowState=Added in DataTable during
processing RowChanged event when I try to add a new row
to a DataTable.
DESCRIPTION:
I'd like to update database as soon as any change was
made in a DataTable. I've tried to implement this
behaviour using two events: RowDeleted and RowChanged.
While RowDeleted event works fine (occurs after a DataRow
has been changed successfully), RowChanged event doesn't
in case I try to add a new row:
1/ e.Row.RowState=Added but
2/ e.Row.Table.Rows.Count=0
So the new row wasn't added to DataTable yet even thought
it has the RowState=Added!
QUESTIONS:
1/ If the new row doesn't exist in DataTable why its
RowState isn't equal to Detached?
2/ If the RowChanged event occures after a change has
been successfully made to DataTable, why the new row
doesn't exist in DataTable yet?
Thanks in advance,
mozek
can anyone help me with the following trouble?
PROBLEM:
There is no row with RowState=Added in DataTable during
processing RowChanged event when I try to add a new row
to a DataTable.
DESCRIPTION:
I'd like to update database as soon as any change was
made in a DataTable. I've tried to implement this
behaviour using two events: RowDeleted and RowChanged.
While RowDeleted event works fine (occurs after a DataRow
has been changed successfully), RowChanged event doesn't
in case I try to add a new row:
1/ e.Row.RowState=Added but
2/ e.Row.Table.Rows.Count=0
So the new row wasn't added to DataTable yet even thought
it has the RowState=Added!
QUESTIONS:
1/ If the new row doesn't exist in DataTable why its
RowState isn't equal to Detached?
2/ If the RowChanged event occures after a change has
been successfully made to DataTable, why the new row
doesn't exist in DataTable yet?
Thanks in advance,
mozek