473,594 Members | 2,692 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to stop RowChanging events from firing on fill

I just realized the DataTable_RowCh anging events were firing when I called
Fill method of the DataAdapter! It fires TWICE for each row loaded. I
thought these were only supposed to be called when data was actually being
edited.

I am using bound textbox controls on the form. Could that have anything to
do with it? Does anyone know how to stop the RowChanging events from
firing?

Thanks!
Denise
Nov 20 '05 #1
7 4566
You can't stop an inherit event like that from firing... you can only "not
handle" it...
"Denise" <we******@indy. rr.com> wrote in message
news:bS******** ********@fe1.co lumbus.rr.com.. .
I just realized the DataTable_RowCh anging events were firing when I called
Fill method of the DataAdapter! It fires TWICE for each row loaded. I
thought these were only supposed to be called when data was actually being
edited.

I am using bound textbox controls on the form. Could that have anything to do with it? Does anyone know how to stop the RowChanging events from
firing?

Thanks!
Denise

Nov 20 '05 #2
Denise,

Not sure why this is happening. I am now assuming that you are doing some
processing in this event that you do not want to happen when the DataAdapter
is being filled. If this is the case then you can handle this in a couple
of ways I can think of:

(1) Define a class level variable call bLoading. Before you call the fill
method set bLoading=True and then set it to False after the fill method. In
the event RowChanging only process if bLoading=False

(2) Do not let VB.NET define the event handler for RowChanging (remove the
handles part of the method declaration) then use a combo of RemoveHandler
and AddHandler before and after the fill method.

Dan

"Denise" <we******@indy. rr.com> wrote in message
news:bS******** ********@fe1.co lumbus.rr.com.. .
I just realized the DataTable_RowCh anging events were firing when I called
Fill method of the DataAdapter! It fires TWICE for each row loaded. I
thought these were only supposed to be called when data was actually being
edited.

I am using bound textbox controls on the form. Could that have anything to do with it? Does anyone know how to stop the RowChanging events from
firing?

Thanks!
Denise

Nov 20 '05 #3
Solex Vs CJ, coming to a Cinema near you soon.

:)

CJ Taylor wrote:
You can't stop an inherit event like that from firing... you can only
"not handle" it...
"Denise" <we******@indy. rr.com> wrote in message
news:bS******** ********@fe1.co lumbus.rr.com.. .
I just realized the DataTable_RowCh anging events were firing when I
called Fill method of the DataAdapter! It fires TWICE for each row
loaded. I thought these were only supposed to be called when data
was actually being edited.

I am using bound textbox controls on the form. Could that have
anything to do with it? Does anyone know how to stop the
RowChanging events from firing?

Thanks!
Denise


--
Best Regards - OHM

O_H_M{at}BTInte rnet{dot}com
Nov 20 '05 #4
And you thought Oscar DeLahoya (sp?) matches were big...

=)
"One Handed Man [ OHM# ]" <O_H_M{at}BTInt ernet{dot}com> wrote in message
news:On******** ******@TK2MSFTN GP12.phx.gbl...
Solex Vs CJ, coming to a Cinema near you soon.

:)

CJ Taylor wrote:
You can't stop an inherit event like that from firing... you can only
"not handle" it...
"Denise" <we******@indy. rr.com> wrote in message
news:bS******** ********@fe1.co lumbus.rr.com.. .
I just realized the DataTable_RowCh anging events were firing when I
called Fill method of the DataAdapter! It fires TWICE for each row
loaded. I thought these were only supposed to be called when data
was actually being edited.

I am using bound textbox controls on the form. Could that have
anything to do with it? Does anyone know how to stop the
RowChanging events from firing?

Thanks!
Denise


--
Best Regards - OHM

O_H_M{at}BTInte rnet{dot}com

Nov 20 '05 #5
(sp?) ?

Regards - OHM

CJ Taylor wrote:
And you thought Oscar DeLahoya (sp?) matches were big...

=)
"One Handed Man [ OHM# ]" <O_H_M{at}BTInt ernet{dot}com> wrote in
message news:On******** ******@TK2MSFTN GP12.phx.gbl...
Solex Vs CJ, coming to a Cinema near you soon.

:)

CJ Taylor wrote:
You can't stop an inherit event like that from firing... you can
only "not handle" it...
"Denise" <we******@indy. rr.com> wrote in message
news:bS******** ********@fe1.co lumbus.rr.com.. .
I just realized the DataTable_RowCh anging events were firing when I
called Fill method of the DataAdapter! It fires TWICE for each row
loaded. I thought these were only supposed to be called when data
was actually being edited.

I am using bound textbox controls on the form. Could that have
anything to do with it? Does anyone know how to stop the
RowChanging events from firing?

Thanks!
Denise


--
Best Regards - OHM

O_H_M{at}BTInte rnet{dot}com


--
Best Regards - OHM

O_H_M{at}BTInte rnet{dot}com
Nov 20 '05 #6
sp? = "is this the correct spelling? I really don't know, but I don't want
to look like a jacka$$"

hows that work for ya.

=)

"One Handed Man [ OHM# ]" <O_H_M{at}BTInt ernet{dot}com> wrote in message
news:uR******** ******@TK2MSFTN GP09.phx.gbl...
(sp?) ?

Regards - OHM

CJ Taylor wrote:
And you thought Oscar DeLahoya (sp?) matches were big...

=)
"One Handed Man [ OHM# ]" <O_H_M{at}BTInt ernet{dot}com> wrote in
message news:On******** ******@TK2MSFTN GP12.phx.gbl...
Solex Vs CJ, coming to a Cinema near you soon.

:)

CJ Taylor wrote:
You can't stop an inherit event like that from firing... you can
only "not handle" it...
"Denise" <we******@indy. rr.com> wrote in message
news:bS******** ********@fe1.co lumbus.rr.com.. .
> I just realized the DataTable_RowCh anging events were firing when I
> called Fill method of the DataAdapter! It fires TWICE for each row
> loaded. I thought these were only supposed to be called when data
> was actually being edited.
>
> I am using bound textbox controls on the form. Could that have
> anything to do with it? Does anyone know how to stop the
> RowChanging events from firing?
>
> Thanks!
> Denise

--
Best Regards - OHM

O_H_M{at}BTInte rnet{dot}com


--
Best Regards - OHM

O_H_M{at}BTInte rnet{dot}com

Nov 20 '05 #7
OK, Now I understand and its me thats the Jackass !
CJ Taylor wrote:
sp? = "is this the correct spelling? I really don't know, but I
don't want to look like a jacka$$"

hows that work for ya.

=)

"One Handed Man [ OHM# ]" <O_H_M{at}BTInt ernet{dot}com> wrote in
message news:uR******** ******@TK2MSFTN GP09.phx.gbl...
(sp?) ?

Regards - OHM

CJ Taylor wrote:
And you thought Oscar DeLahoya (sp?) matches were big...

=)
"One Handed Man [ OHM# ]" <O_H_M{at}BTInt ernet{dot}com> wrote in
message news:On******** ******@TK2MSFTN GP12.phx.gbl...
Solex Vs CJ, coming to a Cinema near you soon.

:)

CJ Taylor wrote:
> You can't stop an inherit event like that from firing... you can
> only "not handle" it...
>
>
> "Denise" <we******@indy. rr.com> wrote in message
> news:bS******** ********@fe1.co lumbus.rr.com.. .
>> I just realized the DataTable_RowCh anging events were firing
>> when I called Fill method of the DataAdapter! It fires TWICE
>> for each row loaded. I thought these were only supposed to be
>> called when data was actually being edited.
>>
>> I am using bound textbox controls on the form. Could that have
>> anything to do with it? Does anyone know how to stop the
>> RowChanging events from firing?
>>
>> Thanks!
>> Denise

--
Best Regards - OHM

O_H_M{at}BTInte rnet{dot}com


--
Best Regards - OHM

O_H_M{at}BTInte rnet{dot}com


--
Best Regards - OHM

O_H_M{at}BTInte rnet{dot}com
Nov 20 '05 #8

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

Similar topics

2
4370
by: J | last post by:
I'm experimenting with strongly typed datasets, and when the .Fill method is called, the RowChanging fires for each row. This causes a problem when the existing data does not adhere to the rules outlined in the RowChanging method. Is there an easy way to not have the RowChanging event occur when the dataset is being filled? Example code is daTitleAuthor.Fill(dsAuthors1);
14
12114
by: JPRoot | last post by:
Hi I use the following syntax to have events inherited from base to child classes which works nicely (virtual and override keyword on events). But I am wondering if it is a "supported" way of using events since I never saw it used anywhere in MSDN documentation/samples?! Or it will just break when I upgrade to .NET Framework 2.x in the coming years namespace MyNamespac public delegate void MyDel() public class MyBase public virtual...
3
2286
by: Mike | last post by:
Hi, I am adding controls dynamically in a WebForm, but none of these controls' events fire. Here is the class code I am using. I have tried so many things, but nothing works :-( namespace WebApplication1 { using System;
1
3113
by: Ahmet Gunes | last post by:
Hi all, I check whether session is alive in Page_Load. If session is not alive then I want to navigate to another page, most probably the login page. But when a control, a button for example, is clicked, after Page_Load the button's click event is also fired. Since session is abandoned at this moment, any object references raise
1
2575
by: AH | last post by:
Hi, I used a dataTable to bind to datagrid. I setup code to handle the rowchanging event but whenever I change from one row to another in the datagrid, the datagrid changed to a white box with a big red-crossed, an error message box with titled "Error when committing the row to the original data store" and prompted "no value at index 0, do you want to correct the value?" I suspect some bugs in VB.NET (2003) since column changing , column...
0
306
by: Denise | last post by:
I just realized the DataTable_RowChanging events were firing when I called Fill method of the DataAdapter! It fires TWICE for each row loaded. I thought these were only supposed to be called when data was actually being edited. I am using bound textbox controls on the form. Could that have anything to do with it? Does anyone know how to stop the RowChanging events from firing? Thanks!
0
984
by: Randy | last post by:
I have various events on my web form, button clicks, checkboxlist index changes, etc. In the course of testing sometimes they stop working (locally). But then if I double click on them (which me to the code behind view) and simply save the form and run it, they start firing again. I don't have webserver right now and know if this will happen when I deploy to it. Is this a bug in Visual Studio?
3
2169
by: mark4asp | last post by:
How can I stop my Calendar control from firing the form validation events? I have a form containing several controls which have several validation controls each. One control is a TextBox where the date is entered. Connected to this is an image button which launches a popup window containing a calendar control. The selected value from the calendar is then fed back to the TextBox.
8
2166
by: Greg (codepug | last post by:
For lack of the proper expression, how do I excite a control to cause events to trigger. I have a date control and am using a calender form button to fill the text box with the date. The text box is bound to a field. All this works great, but now the date range validation is not not working and the after update event that did calculations is not working. This is without question the result of the control not firing because I'm using...
0
7947
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
8255
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...
0
8374
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8010
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
6665
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5413
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
3868
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
1486
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1217
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.