R
rlum
I am trying to produce a the column that contains an
error after an sqldataadapter update. Just connect to a
sql db get a dataset, set the column to a string greater
than the field and try da.update. then catch it a
sqlexception and pass it to this ms sample code:
Private Sub GetAllErrs(ByVal myRow As DataRow)
' Declare an array variable for DataColumn objects.
Dim colArr() As DataColumn
' If the Row has errors, check use GetColumnsInError.
Dim i As Integer
If myRow.HasErrors Then
' Get the array of columns in error.
colArr = myRow.GetColumnsInError()
For i = 0 to colArr.GetUpperBound(0)
' Insert code to fix errors on each column.
Console.WriteLine(colArr(i).ColumnName)
Next i
' Clear errors after reconciling.
myRow.ClearErrors()
End If
End Sub
here is the ms link
http://msdn.microsoft.com/library/default.asp?
url=/library/en-
us/cpref/html/frlrfsystemdatadatarowclassgetcolumnsinerrort
opic.asp
the column array is 0 with no elements! Please help and
thanks in advance
..
error after an sqldataadapter update. Just connect to a
sql db get a dataset, set the column to a string greater
than the field and try da.update. then catch it a
sqlexception and pass it to this ms sample code:
Private Sub GetAllErrs(ByVal myRow As DataRow)
' Declare an array variable for DataColumn objects.
Dim colArr() As DataColumn
' If the Row has errors, check use GetColumnsInError.
Dim i As Integer
If myRow.HasErrors Then
' Get the array of columns in error.
colArr = myRow.GetColumnsInError()
For i = 0 to colArr.GetUpperBound(0)
' Insert code to fix errors on each column.
Console.WriteLine(colArr(i).ColumnName)
Next i
' Clear errors after reconciling.
myRow.ClearErrors()
End If
End Sub
here is the ms link
http://msdn.microsoft.com/library/default.asp?
url=/library/en-
us/cpref/html/frlrfsystemdatadatarowclassgetcolumnsinerrort
opic.asp
the column array is 0 with no elements! Please help and
thanks in advance
..