473,386 Members | 1,752 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,386 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 1282
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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.