473,406 Members | 2,217 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

dataSet acceptChanges

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

Jul 21 '05 #1
4 1284
Hi,

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

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
miha at rthand com
www.rthand.com

"s-galit" <sg****@discussions.microsoft.com> wrote in message
news:F3**********************************@microsof t.com...
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

Jul 21 '05 #2
i tried e.row.item("res") but its not working...
??

Jul 21 '05 #3
Have you tried this:
e.Row.SetColumnError("res", "Result cannot be " & CStr(num3))
"s-galit" wrote:
i tried e.row.item("res") but its not working...
??

Jul 21 '05 #4
thanks its working

"Yang Lu" wrote:
Have you tried this:
e.Row.SetColumnError("res", "Result cannot be " & CStr(num3))


Jul 21 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: ScottDizzy | last post by:
I'm trying to load an xml file into a dataset, then load the same xml file with a slight change into a second dataset, then do a merge to see what changed between datasets. DataSet xmlDataSet...
1
by: Shahar | last post by:
Hi what's worng with the following code, the chages I made is only change the DataSet but not the Data-Base: try { DataSet ds = new DataSet(); OleDbDataAdapter adapter = new...
2
by: Mojtaba Faridzad | last post by:
Hi, Please check these lines: DataSet dataSet = new DataSet(); dataAdapter.Fill(dataSet, "mytable"); DataRow row; row = dataSet.Tables.Rows; row.BeginEdit(); row = "555";
7
by: Zachary Hilbun | last post by:
The below is some test code to help me learn how to update a dataset. It is supposed to read the value of UserCounter and write it back. The UserCounter is being read correctly as 0, is 1 when...
2
by: Calvin KD | last post by:
Hi everyone, I know the solution to my problem is probably very simple but I just can't seem to figure out how to do it. My problem is, I have an XML file as a datastore, I read it into a dataset...
11
by: tomp | last post by:
Hi, I am trying to insert a row into the Categories Table in Nothwinds database in MSDE. I am able to manually insert it using a query tool. Using the Debugger, it appears the DataSet loads...
10
by: jaYPee | last post by:
does anyone experienced slowness when updating a dataset using AcceptChanges? when calling this code it takes many seconds to update the database SqlDataAdapter1.Update(DsStudentCourse1)...
12
by: Graham Blandford | last post by:
Hi all, Would someone be able to tell me the most 'graceful' way of removing unwanted rows from a dataset based on a condition prior to update? OR, resetting the rows all to unchanged after they...
0
by: buk110 | last post by:
Hi guys, I'm really hoping that someone can help me... I have 3 datasets. One that will contain the initial information when I open up the database; one that will pull in information afterwards;...
12
by: Brian | last post by:
I want to create an In Memory dataset. not connected to any database.. but putting my own info in from code or a file.... What are the steps to do this? Where can I find some info on how to do...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.