473,472 Members | 2,211 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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.
Jul 19 '05 #1
7 3126
"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

Jul 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.

Jul 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

Jul 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

Jul 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

Jul 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


Jul 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



Jul 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...
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: 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
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,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.