Got System.Data.ConstraintException Error on second OleDbDataAdapter filling dataset
Posted on 2005-04-12
This looks a very simple project, but I just have no clue why it is not work. Please Help!
I did the things as following:
1. drag to create OleDbDataAdapter1 on form and configure it with Query builder to get data from project table
2. Create dataset DataSet11 from OleDbDataAdapter1
3. drag to create OleDbDataAdapter2 on form and configure it with Query builder to get data from Project Detail Table.
4. Create Dataset DataSet11 from OleDbDataAdapter2
5. Configure the scheme for DataSet11, create relationship between Project table and project detail table
with projectid as keyconstraint.
6. on Form1_load I have code like following:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
OleDbDataAdapter2.Fill(DataSet11) <======= Give me the system.Data.ConstraintException Error
It always give me the unhandled exception of type 'system.data.constraintException Error', with additional information:
Failed to enable constraints. One or more rows contain values viloating non-null, unique, or foreign-key constraints.
Can anyone help me with this? Since I can create a query and run in SQL without any problem.