|
-
Apr 3rd, 2020, 06:37 AM
#1
Thread Starter
Lively Member
Visual Studio 2017 - System.Data.ConstraintException
Dear all,
I'm having some issue with my application.
Basically I have a form where I'm initializing a datagridview. From this form I'm the loading another form (without closing the first form) where I have another datagridview which loads data from the same table of the other datagridview.
Here below the code of the first form:
Private Sub Analisi_Load(sender As Object, e As EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the 'CTO_ManagementDataSet7.Tbl_CTOPartiteOss' table. You can move, or remove it, as needed.
Me.Tbl_CTOPartiteOssTableAdapter.Fill(Me.CTO_ManagementDataSet7.Tbl_CTOPartiteOss)
'TODO: This line of code loads data into the 'CTO_ManagementDataSet6.Tbl_CTOSquadre' table. You can move, or remove it, as needed.
Me.Tbl_CTOSquadreTableAdapter.Fill(Me.CTO_ManagementDataSet6.Tbl_CTOSquadre)
DtGrdSquadreOss.SelectionMode = DataGridViewSelectionMode.FullRowSelect
DtGrdPartiteOss.SelectionMode = DataGridViewSelectionMode.RowHeaderSelect
End Sub
While here the code of the second one:
Private Sub Details_Load(sender As Object, e As EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the 'CTO_ManagementDataSet.Tbl_CTOPartiteOss' table. You can move, or remove it, as needed.
Me.Tbl_CTOPartiteOssTableAdapter.Fill(Me.CTO_ManagementDataSet.Tbl_CTOPartiteOss)
End Sub
Now, as said, when loading the second form I'm getting the following error: "System.Data.ConstraintException: 'Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.' "
I believe it is because the first form is not closed. Any suggestion?
Thanks,
A.
Tags for this Thread
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
|