By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,856 Members | 2,015 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,856 IT Pros & Developers. It's quick & easy.

e.action on rowchanged event not agreeing with dataTable.select(dataviewRowState.added)

P: n/a

I am trapping the rowchanged event on a table. I have the following code:

If e.Action = DataRowAction.Add Then

ds.Merge(CType(sender, DataTable).Select("", "",
System.Data.DataViewRowState.Added))
The funny thing is - the merge operation captures No rows.

This appears to be a big contradiction........

Any idea why this is happening?
Nov 23 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
I've googled this some more and discovered it is a bug in .net 1.1 (fixed in
2.0)

I've tried a work-around to force the insert (listed on a google post):

ds.Tables(e.Row.Table.TableName).Rows.Add(e.Row.It emArray)

But this yeilds 0 rows in the ds.

If i look at the e.row.itemArray in the command window - I get a row
populated with expected values:

? e.Row.ItemArray
{Length=3}
(0): {System.Guid}
(1): {System.Guid}
(2): #1/1/2006#

But when I run the code to add the row to the DS in the immediate window I
get the following:

ds.Tables(e.Row.Table.TableName).Rows.Add(e.Row.It emArray)
Referenced object has a value of 'Nothing'.

Please note that the 'ds' is declared as follows: "Dim ds as new dataset"

Is there a solution to this? Do I build a custom datarow by hand and pass
it to my ds? Does everybody just avoid using the rowchanged event for
updating the backend in ADO.NET 1.1 ?.........????

stro" <as***@mnrr.com> wrote in message
news:gA*****************@tornado.rdc-kc.rr.com...

I am trapping the rowchanged event on a table. I have the following code:

If e.Action = DataRowAction.Add Then

ds.Merge(CType(sender, DataTable).Select("", "",
System.Data.DataViewRowState.Added))
The funny thing is - the merge operation captures No rows.

This appears to be a big contradiction........

Any idea why this is happening?

Nov 23 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.