Error on merge

  • Thread starter Thread starter John
  • Start date Start date
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
 
Back
Top