P
PAUL
Hello,
I have 2 datasets I am trying to update. The parent table seems to
update fine but when I go update the chiled table I get an error message
that says I need a related record in the parent table. However I put some
code in to display the key field of each parent table record (parent
dataset) and the value I am trying to put into the child table is there.
ParentTable ChildTable
ID------------------------< ParentTableID
Now because I havnt commited the transaction yet the parenttable would still
not have the new record in the DB yet, but surely it should check against
the parent table dataset not the DB?
As I said earlier all the records in the childtable dataset have related
records in the parenttable dataset so I cant understand why its
complaing....!
Any help would be appreciated...
Thanks
Paul M
'Update parent table (works ok)
daObjectsTable.DeleteCommand.Transaction = trnMain
daObjectsTable.InsertCommand.Transaction = trnMain
daObjectsTable.UpdateCommand.Transaction = trnMain
daObjectsTable.Update(dsIssue, "tblObjects")
'Update child table (fails on update)
daAffectedObjects.DeleteCommand.Transaction = trnMain
daAffectedObjects.InsertCommand.Transaction = trnMain
daAffectedObjects.UpdateCommand.Transaction = trnMain
daAffectedObjects.Update(dsIssue, "tblAffectedObjects") <---- Fails here
I have 2 datasets I am trying to update. The parent table seems to
update fine but when I go update the chiled table I get an error message
that says I need a related record in the parent table. However I put some
code in to display the key field of each parent table record (parent
dataset) and the value I am trying to put into the child table is there.
ParentTable ChildTable
ID------------------------< ParentTableID
Now because I havnt commited the transaction yet the parenttable would still
not have the new record in the DB yet, but surely it should check against
the parent table dataset not the DB?
As I said earlier all the records in the childtable dataset have related
records in the parenttable dataset so I cant understand why its
complaing....!
Any help would be appreciated...
Thanks
Paul M
'Update parent table (works ok)
daObjectsTable.DeleteCommand.Transaction = trnMain
daObjectsTable.InsertCommand.Transaction = trnMain
daObjectsTable.UpdateCommand.Transaction = trnMain
daObjectsTable.Update(dsIssue, "tblObjects")
'Update child table (fails on update)
daAffectedObjects.DeleteCommand.Transaction = trnMain
daAffectedObjects.InsertCommand.Transaction = trnMain
daAffectedObjects.UpdateCommand.Transaction = trnMain
daAffectedObjects.Update(dsIssue, "tblAffectedObjects") <---- Fails here