Error on merge

J

John

Hi

I am getting error "Failed to enable constraints. One or more rows contain
values violating non-null, unique, or foreign-key constraints." when using
merge to update the changed rows in a datagarid. Here is the code I am
using;

Public Sub UpdateDataSet()
Dim objDataSetChanges As Contacts.dsContacts = New
Contacts.dsContacts

Me.BindingContext(objdsSetup, "tblvTypes").EndCurrentEdit()

objDataSetChanges = CType(objdsSetup.GetChanges,
Contacts.dsContacts)

If (Not (objDataSetChanges) Is Nothing) Then

Me.OleDbConnection1.Open()

OleDbDataAdapter1.Update(objDataSetChanges)

objdsSetup.Merge(objDataSetChanges) ' <== Error comes on this
line

objdsSetup.AcceptChanges()

End If

End Sub


Any help would be appreciated.

Thanks

Regards
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top