F
Flomo Togba Kwele
I've defined a dataset containing 3 tables via the DataSource
Configuration Wizard.
In the UserControl.Load event, I place:
Try
clientAdapter.Fill(DsClient.Client)
personAdapter.Fill(DsClient.Person)
addressAdapter.Fill(DsClient.Address)
Catch
PrintAllErrs(DsClient)
End Try
At the first fill (client), I get the following error:
A first chance exception of type 'System.Data.ConstraintException'
occurred in System.Data.dll
In the PrintAllErrs routine, I get a reference to each table's errors
(GetErrors) and list each column in error along with its error:
If table.HasErrors Then
' Get an array of all rows with errors.
rowsInError = table.GetErrors()
' Print the error of each column in each row.
For i = 0 To rowsInError.GetUpperBound(0)
For Each column In table.Columns
Console.WriteLine(column.ColumnName, _
rowsInError(i).GetColumnError(column))
Next
It writes out each column in the first table, with an empty string for
the column error for each column.
If I precede the Try above with ds.EnforceConstraints = False,
everything looks like it's working OK.
What's wrong here?
TIA
Configuration Wizard.
In the UserControl.Load event, I place:
Try
clientAdapter.Fill(DsClient.Client)
personAdapter.Fill(DsClient.Person)
addressAdapter.Fill(DsClient.Address)
Catch
PrintAllErrs(DsClient)
End Try
At the first fill (client), I get the following error:
A first chance exception of type 'System.Data.ConstraintException'
occurred in System.Data.dll
In the PrintAllErrs routine, I get a reference to each table's errors
(GetErrors) and list each column in error along with its error:
If table.HasErrors Then
' Get an array of all rows with errors.
rowsInError = table.GetErrors()
' Print the error of each column in each row.
For i = 0 To rowsInError.GetUpperBound(0)
For Each column In table.Columns
Console.WriteLine(column.ColumnName, _
rowsInError(i).GetColumnError(column))
Next
It writes out each column in the first table, with an empty string for
the column error for each column.
If I precede the Try above with ds.EnforceConstraints = False,
everything looks like it's working OK.
What's wrong here?
TIA