|
-
Sep 7th, 2002, 08:59 AM
#1
Thread Starter
Lively Member
!!! Primary Key Error Urgent !!!
Hi,
Some how tried to write reterive code but got this error when issued this code dataset.EnforceConstrationst = True
"Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints."
How should i go about ...
Please guide
Wrgds
Ganesh.K
-
Sep 7th, 2002, 09:21 AM
#2
Addicted Member
Hi
try and check the table you are retriveing data from and make sure there is no duplicate value or null value before you set dataset.EnforceConstrationst = True in your code
-
Sep 7th, 2002, 09:32 AM
#3
Thread Starter
Lively Member
Hi,
below is the code is written in txtempno validate
''''
Me.objdsEmployee.EnforceConstraints = False
sCurrentValue = txtEmpNo.Text
Me.BindingContext(objdsEmployee, "employee").CancelCurrentEdit()
Me.objdsEmployee.Clear()
Me.BindingContext(objdsEmployee, "employee").CancelCurrentEdit()
Me.OleDbDataAdapterEmployee.SelectCommand.Parameters("employeeCode").Value = sCurrentValue
Me.OleDbDataAdapterEmployee.Fill(objdsEmployee)
Me.OleDbDataAdapter2.Fill(objdsEmployee)
Me.objdsEmployee.EnforceConstraints = True
''''
in the above code which point should i check fields are having null values..
please guide i'm new to VB.Net
Wrgds
Ganesh.K
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|