dataSet acceptChanges

G

Guest

when im doing dataSet1.tables(0).acceptChanges the rowChanging event is called
and im getting an error -"cannot find columns 8"
i dont know why im getting this error
can someone tell me what is wrong??

Private Sub exercise_rowchanging(ByVal sender As Object, ByVal e As
System.Data.DataRowChangeEventArgs)

Dim num1 As New Integer
Dim num2 As New Integer
Dim num3 As New Integer
num1 = e.Row.Item(0)
num2 = e.Row.Item(1)
num3 = e.Row.Item(2)
If CInt(num3) <> CInt(num1) + CInt(num2) Then
e.Row.RowError = "The result column contians an error"
e.Row.SetColumnError(e.Action, "Result cannot be " & CStr(num3))
End If
End sub

thanks
 
M

Miha Markic [MVP C#]

Hi,

Instead of column (or column index) you are passing e.Action parameter to
SetColumnError method.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top