473,405 Members | 2,445 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,405 software developers and data experts.

Question about SqlDataAdapter.RowUpdating Event

Hi,

I'm working on a WebService project. I'm trying to validate data before they
are updated to the database by handling the RowUpdating event for a
SqlDataAdapter.

The data being handled has DataRelation which is related to another
DataTable. As for that, I also need to retrieve the DataRelation from the
current row being updated. I wrote a code which look something like this,
Dim relation As DataRelation
For Each relation In e.Row.Table.ChildRelations
Dim rows As DataRow()

' e.Row.GetChildRows(relation) will always return nothing
rows = e.Row.GetChildRows(relation)
Next

If you try this code, e.Row.GetChildRows(relation) will always return
nothing even though the DataTable which contains the DataRow has
DataRelation.

Beside that, the e.Row.HasErrors and e.Row.RowError properties will also
return nothing.

Is this a bug in .NET Framework 1.1 or I need to change the coding.

Thanks.
Nov 19 '05 #1
7 3955
"Programatix" <pr*********@nospam.com> schrieb
Newsgroups:

microsoft.public.dotnet.framework,microsoft.public .dotnet.framework.adonet,m
icrosoft.public.dotnet.framework.webservices,micro soft.public.dotnet.general
,microsoft.public.dotnet.languages.vb
Whenever making crossposts, please use *only* the appropriate groups. This
is not related to VB.Net.

Armin

Nov 19 '05 #2
I've finally found where the problem lies. It's my fault actually. When I
asked the SqlDataAdapter to update to database, I used the following
overloaded Update method,
Overloads Public Function Update(DataTable) As Integer

Because of this, the information included in the DataSet is not included in
the RowUpdating event.

The original idea to use DataTable instead of DataSet is because in my
opinion, sending the DataTable will be faster than DataSet, but it seems to
produce more problem than I have ever thought of.

Sigh...

Thanks for reading.

"Programatix" <pr*********@nospam.com> wrote in message
news:eK**************@TK2MSFTNGP10.phx.gbl...
Hi,

I'm working on a WebService project. I'm trying to validate data before they are updated to the database by handling the RowUpdating event for a
SqlDataAdapter.

The data being handled has DataRelation which is related to another
DataTable. As for that, I also need to retrieve the DataRelation from the
current row being updated. I wrote a code which look something like this,
Dim relation As DataRelation
For Each relation In e.Row.Table.ChildRelations
Dim rows As DataRow()

' e.Row.GetChildRows(relation) will always return nothing
rows = e.Row.GetChildRows(relation)
Next

If you try this code, e.Row.GetChildRows(relation) will always return
nothing even though the DataTable which contains the DataRow has
DataRelation.

Beside that, the e.Row.HasErrors and e.Row.RowError properties will also
return nothing.

Is this a bug in .NET Framework 1.1 or I need to change the coding.

Thanks.

Nov 19 '05 #3
Why is it not related to VB .Net? I'm using VB .Net to write the code. As
for that, it should be related to VB .Net.

"Armin Zingler" <az*******@freenet.de> wrote in message
news:u4**************@TK2MSFTNGP10.phx.gbl...
"Programatix" <pr*********@nospam.com> schrieb
Newsgroups:

microsoft.public.dotnet.framework,microsoft.public .dotnet.framework.adonet,m icrosoft.public.dotnet.framework.webservices,micro soft.public.dotnet.general ,microsoft.public.dotnet.languages.vb
Whenever making crossposts, please use *only* the appropriate groups. This
is not related to VB.Net.

Armin

Nov 19 '05 #4
Still sometime, anyone with VB skill could have known the solution and that
someone, since always used VB only browse the VB newsgroup, might not browse
the ADO .Net newsgroup. And in this case, that someone might not know that
his/her help is needed.

:)

"Armin Zingler" <az*******@freenet.de> wrote in message
news:Oz**************@TK2MSFTNGP11.phx.gbl...
"Programatix" <pr*********@nospam.com> schrieb
Why is it not related to VB .Net? I'm using VB .Net to write the
code. As for that, it should be related to VB .Net.
Would it be the same question in C#? If yes, it's not related to VB. As

the subject (and the question) shows, it's a about ADO.Net and the Framework
class library, no matter which language you use. So it's not a VB.Net
related question, IMHO.

Armin

Nov 19 '05 #5
"Programatix" <pr*********@nospam.com> schrieb
Still sometime, anyone with VB skill could have known the solution
and that someone, since always used VB only browse the VB newsgroup,
might not browse the ADO .Net newsgroup. And in this case, that
someone might not know that his/her help is needed.

:)


Then you should also post to alt.binaries.cartoons.french because there
might be someone who can help you. ;-)

Armin

Nov 19 '05 #6
Depends on whether you want a good answer, or any answer.

I actually skimmed by this yesterday because I was in a rush and saw that
Armin had answered you.

Good that you answered your question, but I think crossposting rarely helps
you get the answer your looking for (except when the issue lies on teh seam
between multiple groups).

--
Kathleen (MVP-VB)

"Programatix" <pr*********@nospam.com> wrote in message
news:ej**************@TK2MSFTNGP10.phx.gbl...
Still sometime, anyone with VB skill could have known the solution and that someone, since always used VB only browse the VB newsgroup, might not browse the ADO .Net newsgroup. And in this case, that someone might not know that
his/her help is needed.

:)

"Armin Zingler" <az*******@freenet.de> wrote in message
news:Oz**************@TK2MSFTNGP11.phx.gbl...
"Programatix" <pr*********@nospam.com> schrieb
Why is it not related to VB .Net? I'm using VB .Net to write the
code. As for that, it should be related to VB .Net.


Would it be the same question in C#? If yes, it's not related to VB. As

the
subject (and the question) shows, it's a about ADO.Net and the Framework
class library, no matter which language you use. So it's not a VB.Net
related question, IMHO.

Armin


Nov 19 '05 #7
In my case now, I want any answer.

Anyway, enough is enough. There is no need for arguement here. Armin has his
point but sometime, that someone needed a quick respond and any responds are
considered good, even though it's not.

"Kathleen Dollard" <ka******@mvps.org> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Depends on whether you want a good answer, or any answer.

I actually skimmed by this yesterday because I was in a rush and saw that
Armin had answered you.

Good that you answered your question, but I think crossposting rarely helps you get the answer your looking for (except when the issue lies on teh seam between multiple groups).

--
Kathleen (MVP-VB)

"Programatix" <pr*********@nospam.com> wrote in message
news:ej**************@TK2MSFTNGP10.phx.gbl...
Still sometime, anyone with VB skill could have known the solution and

that
someone, since always used VB only browse the VB newsgroup, might not

browse
the ADO .Net newsgroup. And in this case, that someone might not know that his/her help is needed.

:)

"Armin Zingler" <az*******@freenet.de> wrote in message
news:Oz**************@TK2MSFTNGP11.phx.gbl...
"Programatix" <pr*********@nospam.com> schrieb
> Why is it not related to VB .Net? I'm using VB .Net to write the
> code. As for that, it should be related to VB .Net.

Would it be the same question in C#? If yes, it's not related to VB. As
the
subject (and the question) shows, it's a about ADO.Net and the

Framework class library, no matter which language you use. So it's not a VB.Net
related question, IMHO.

Armin



Nov 19 '05 #8

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

Similar topics

7
by: Programatix | last post by:
Hi, I'm working on a WebService project. I'm trying to validate data before they are updated to the database by handling the RowUpdating event for a SqlDataAdapter. The data being handled has...
4
by: Patrick.O.Ige | last post by:
I have a CheckBoxList in a DataList and i'm trying to get item Selected after doing a postBack. I have set my CheckBoxlist AutoPostBack="True" Any ideas what 'm doing wrong? It seems not to...
0
by: Sam | last post by:
Hi, Just starting to get to grips with vb.net, a huge improvement over VB6 (but not so impressed with the help). I am trying to write a business class which uses a SQLDataAdapter object and...
3
by: slemen | last post by:
The controls (textboxes) in the gridview row being updated have the old, pre user updated values in the RowUpdating event. Does anyone have an idea why? Thank you, Scott
1
by: anniec | last post by:
I am trying to access a text box in a grid that the user has changed. I tried a bunch of stuff in the RowUpdating event. None of them is giving me the value in the text box. 'doesn't work Dim...
9
by: John007 | last post by:
I am using a SQLDataSource to populate my gridview in ASP.Net 2.0. When I hit Edit, the textboxes appear and I am able to edit my values. When I hit Update, the changes are not saved, and there is no...
7
by: Justin | last post by:
Hi, this code updates a table with the new values with the event RowUpdating of a gridview. Protected Sub GridView1_RowUpdating(ByVal sender As Object, ByVal e As...
1
by: Steve Kershaw | last post by:
Hi, I'm using the RowUpdating() event of an updatable GridView. I need to see the values of the columns in the updated row. There has got to be a way to do this! Any suggestions? Thanks...
0
by: E. Kwong | last post by:
In a Gridview control, I have several BoundFields, and also a couple of TemplateFields. In the Rowupdating event, I try to retrieve one of the BoundFields (i.e. 4th column of the Gridview...
2
by: =?Utf-8?B?U2F2dm91bGlkaXMgSW9yZGFuaXM=?= | last post by:
Which is the event sequence when a gridview button (for update) is clicked and the page is post back? I am also a bit confused when to use ..IsPostBack(). If my page data is changing maybe in every...
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...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
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.