Hi Flomo,
Accoding to your description, I understand you get the following error
message when you use Update() method to insert datarows into underlying
database. If I misunderstand anything here, please don't hesitate to
correct me.
The UPDATE statement conflicted with the FOREIGN KEY constraint "FK_Rel".
The conflict occurred in database "MailHaus", table "dbo.Parent", column
'ParentPK'.The statement has been terminated.
Would you please provide some code snippet about how did you update
dataset? It seems like you update the child table first and then the parent
table. Because there is no related identity in parent table, SQL throw the
exception that conflict with the FOREIGN KEY constraint. If you want to
insert parent-child dataset into database, you would have to insert the
parent rows first and then the child rows. Otherwise, you will receive the
error message such as "conflicted with the FOREIGN KEY constraint"
Hope this helps.Please let me know if you still have anything unclear. I'm
glad to assist you.
Sincerely,
Wen Yuan
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx. ==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.