Strange Dataset update problem passing to Webservice

  • Thread starter Thread starter Neil.Smith
  • Start date Start date
N

Neil.Smith

I've encountered a strange problem when trying to update data in two
tables using a dataset. My application is split between a client
(presentation) and webservice (business and DAL).

I have a typed dataset, HSEDataset, containing two tables related by a
foreign key constraint. I use the standard GetChanges() method to get
a dataset containing only the changes to the tables, looking at these
tables I can see my changes on the client, i.e. 1 row in table 1 and 1
row in table 2, so far so good.

When I send the dataset to my webservice, however, I get 1 row in
table 1 and 0 rows in table 2?? The first table is subsequently
updated without a problem, the second obviously updates nothing. I've
since simplified things even further by just sending the second table,
however, using GetChanges on the dataset and sending the subsequent
table still doesn't work:

Dim pChanges As DataSet = Me.HSEDataset.GetChanges
Dim mychanges As HSECoreBLL.HSEDataset.IncidentsDataTable =
pChanges.Tables(1)

But calling GetChanges directly does:

Dim mychanges2 As HSECoreBLL.HSEDataset.IncidentsDataTable =
Me.HSEDataset.Tables(1).GetChanges

Both methods show 1 row in the resultant table after calling
GetChanges on the client, but only with the second method does the
webservice receive this row!! Something must be happening when the
data is being marshalled and sent to the webservice, but I can't find
the problem replicated anywhere else, any ideas?
 
I've now answered my own question, I had the Accept/Reject rule set to
cascade against the foreign key relation between the two tables, as a
result it was accepting the changes for BOTH tables after the first
one was updated, hence the second table had no rows to update (or so
it thought).
 
I am using single table update,

I am using oledb and I dont know why my application works fine under Visual
net IDE, and send me the error When I try to just test at internet explorer,
while I suppose the application works fine,

so, as the application works fine in the visual net IDE then, I can't
reproduce even debug the error to fix it.

any idea?
 
Back
Top