Hi, why do i keep getting the following:
Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.
come up when trying to use the table adapter.
I found an article at
to displays any constraint errors and adapted to my application:
Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.
come up when trying to use the table adapter.
I found an article at
to displays any constraint errors and adapted to my application:
Code:
Dim myDataSet As New KIT
Dim rowsInError() As Data.DataRow
Dim myTable As Data.DataTable
Dim i As Integer
Dim myCol As Data.DataColumn
For Each myTable In myDataSet.Tables
' Test if the table has errors. If not, skip it.
If myTable.HasErrors Then
' Get an array of all rows with errors.
rowsInError = myTable.GetErrors()
' Print the error of each column in each row.
For i = 0 To rowsInError.GetUpperBound(0)
For Each myCol In myTable.Columns
Response.Write(myCol.ColumnName & " " & rowsInError(i).GetColumnError(myCol))
Next
' Clear the row errors
rowsInError(i).ClearErrors()
Next i
End If
Next
but nothing gets displayed. Appreciate if someone could tell me what is wrong with my script above.
Thanks