SQL exception MS Sample dosen't work. HELP

Results 1 to 2 of 2

Thread: SQL exception MS Sample dosen't work. HELP

  1. #1
    Join Date
    Dec 1969

    Default SQL exception MS Sample dosen't work. HELP

    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 and update. then catch it a sqlexception and pass it to this ms sample code:<BR><BR>Private Sub GetAllErrs(ByVal myRow As DataRow)<BR> &#039; Declare an array variable for DataColumn objects.<BR> Dim colArr() As DataColumn <BR> &#039; If the Row has errors, check use GetColumnsInError.<BR> Dim i As Integer<BR> If myRow.HasErrors Then <BR> &#039; Get the array of columns in error.<BR> colArr = myRow.GetColumnsInError()<BR> For i = 0 to colArr.GetUpperBound(0)<BR> &#039; Insert code to fix errors on each column.<BR> Console.WriteLine(colArr(i).ColumnName)<BR> Next i<BR> &#039; Clear errors after reconciling.<BR> myRow.ClearErrors()<BR> End If<BR> End Sub<BR>here is the ms link<BR>http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdatadatarowclassgetcolumnsinerrortopic. asp<BR><BR>the column array is 0 with no elements! Please hep and thanks in advance.

  2. #2
    Join Date
    Dec 1969

    Default ASP.NET forum


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts