473,804 Members | 3,481 Online
Bytes | Software Development & Data Engineering Community
+ 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.Chi ldRelations
Dim rows As DataRow()

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

If you try this code, e.Row.GetChildR ows(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 3155
"Programati x" <pr*********@no spam.com> schrieb
Newsgroups:

microsoft.publi c.dotnet.framew ork,microsoft.p ublic.dotnet.fr amework.adonet, m
icrosoft.public .dotnet.framewo rk.webservices, microsoft.publi c.dotnet.genera l
,microsoft.publ ic.dotnet.langu ages.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(DataTabl e) 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.

"Programati x" <pr*********@no spam.com> wrote in message
news:eK******** ******@TK2MSFTN GP10.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.Chi ldRelations
Dim rows As DataRow()

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

If you try this code, e.Row.GetChildR ows(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*******@free net.de> wrote in message
news:u4******** ******@TK2MSFTN GP10.phx.gbl...
"Programati x" <pr*********@no spam.com> schrieb
Newsgroups:

microsoft.publi c.dotnet.framew ork,microsoft.p ublic.dotnet.fr amework.adonet, m icrosoft.public .dotnet.framewo rk.webservices, microsoft.publi c.dotnet.genera l ,microsoft.publ ic.dotnet.langu ages.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*******@free net.de> wrote in message
news:Oz******** ******@TK2MSFTN GP11.phx.gbl...
"Programati x" <pr*********@no spam.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
"Programati x" <pr*********@no spam.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.ca rtoons.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)

"Programati x" <pr*********@no spam.com> wrote in message
news:ej******** ******@TK2MSFTN GP10.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*******@free net.de> wrote in message
news:Oz******** ******@TK2MSFTN GP11.phx.gbl...
"Programati x" <pr*********@no spam.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******** ********@tk2msf tngp13.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)

"Programati x" <pr*********@no spam.com> wrote in message
news:ej******** ******@TK2MSFTN GP10.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*******@free net.de> wrote in message
news:Oz******** ******@TK2MSFTN GP11.phx.gbl...
"Programati x" <pr*********@no spam.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
3966
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 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
4
4044
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 work:( Thanks My CheckBoxList in the DataList Below
0
787
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 handles the RowUpdating event to construct the appropriate SQL command. When the event is fired with argument e, and e.StatementType = StatementType.Update
3
9808
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
1556
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 test As String = GridView1.Rows(0).Cells(4).Text ' This doesn't show the value in the text box either. Dim test As Integer = GridView1.Rows(e.RowIndex).Cells(4).Text
9
26928
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 error message. I put a breakpoint on the RowUpdating event handler and found that the event is not fired. Right now, I have not written code for the Update event. I am just wondering why the event is not firing. Here Person_ID is the primary key....
7
5070
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 System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GridView1.RowUpdating Dim vlgn As Int16
1
9568
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 in advance!
2
1452
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 10 or 20 seconds, should I use .IsPostback? If not, then the gridviews databinding in the page should be written in Page_Load or in the other events like SelectedIndexChanged, RowCommand where the click is handled? TIA Iordanis
0
9710
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9589
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10593
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10329
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6858
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5663
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4304
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3830
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3000
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.