So, I have insert into my project a DataSet through the DataSet Wizzard. - The DataSet has a master table with two relations.
I do the following code:
Code: Select all
Try
            Me.KundenstammTableAdapter.Fill(Me.DtsÜbersicht.kundenstamm, KundenNr)
        Catch ex As System.Exception
            System.Windows.Forms.MessageBox.Show(ex.Message)
        End Try
        Me.DtsÜbersicht.EnforceConstraints = True
        'TODO: This line of code loads data into the 'DtsÜbersicht.kontaktlinse' table. You can move, or remove it, as needed.
'Here I get the Error (ConstraintException occured)
        Me.KontaktlinseTableAdapter.Fill(Me.DtsÜbersicht.kontaktlinse)
        'TODO: This line of code loads data into the 'DtsÜbersicht.brille' table. You can move, or remove it, as needed.
        Me.BrilleTableAdapter.Fill(Me.DtsÜbersicht.brille)
        'TODO: This line of code loads data into the 'DtsÜbersicht.handelsware' table. You can move, or remove it, as needed.
        Me.HandelswareTableAdapter.Fill(Me.DtsÜbersicht.handelsware)
THX