473,394 Members | 1,902 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,394 software developers and data experts.

VB.NET Events Failure

Hi,
I've got a big problem!
I've written an application in VB.NET that read some data from an
Access database.
I've used DataTable object with its events (RowChanging, RowChanged,
etc.).
When the user changes someting in a row and goes to another row,
RowChanging event fire:

Private Sub MyDataTable_RowChanging(ByVal sender As Object, ByVal e As
System.Data.DataRowChangeEventArgs) Handles MyDataTable.RowChanging
Dim ret As MsgBoxResult
ret = MsgBox("Save changes?", MsgBoxStyle.YesNoCancel)
If _
ret = MsgBoxResult.Yes _
Then
' ... accept changes (and continue!!)
If _
ret = MsgBoxResult.No _
Then
' ... reject changes (and continue!!)
Else
' I want keep this row until user don't choose Yes or No
End If
End Sub

How can I fail the event execution??
It's possible??
Any ideas!
Thanks, LucaJonny

Jul 22 '05 #1
1 2338
I assume your question revolves around what to do when the "Cancel" button is
clicked. If you want to hold onto the data in the row when that button is
clicked how 'bout simply copying the DataRow from the DataTable into a new
DataRow instance.

How is the functionality of clicking the "No" button different than that for
clicking "Cancel?"

..ARN.

When the user changes someting in a row and goes to another row,
RowChanging event fire:

Private Sub MyDataTable_RowChanging(ByVal sender As Object, ByVal e As
System.Data.DataRowChangeEventArgs) Handles MyDataTable.RowChanging
Dim ret As MsgBoxResult
ret = MsgBox("Save changes?", MsgBoxStyle.YesNoCancel)
If _
ret = MsgBoxResult.Yes _
Then
' ... accept changes (and continue!!)
If _
ret = MsgBoxResult.No _
Then
' ... reject changes (and continue!!)
Else
' I want keep this row until user don't choose Yes or No
End If
End Sub

How can I fail the event execution??
It's possible??
Any ideas!
Thanks, LucaJonny

Jul 22 '05 #2

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

Similar topics

2
by: Ken Varn | last post by:
I need to pragmatically add events to the Win2K Event Viewer from my ASP.NET web application. What user rights are required for this? I have tried to assign "act as part of the operating system",...
4
by: Tim | last post by:
There are a set of clients who need to be notified of certain events. I have used events and delegates (publisher-Subscriber model) for the notification mechanism. All the clients register with...
23
by: pamelafluente | last post by:
Hi guys! I want to do a large number of scheduled task (say 80). Each task can be run at a certain time every given weekday. For instance at 10am and 5pm on each monday, etc. I would like to...
2
by: TS | last post by:
when i try to do a response.flush and .end, the screen ends up blank. I want all page processing to quit when a check in the pageload event fails. Since control events occur after load, how do i...
7
by: Bruce HS | last post by:
I'd like to call my ancestor Validation Function every time any control on a Win Form generates a Validating or Validated event. I'm using VB. I've extended Textbox, for instance, to have its...
20
by: David Levine | last post by:
I ran into a problem this morning with event accessor methods that appears to be a bug in C# and I am wondering if this a known issue. public event SomeDelegateSignature fooEvent; public event...
0
by: ABC | last post by:
How to delegate IIS's FTP File Upload and Upload Failure Events from C#?
2
by: davidratz | last post by:
I run Access 2000. We still have Access 97 resident on our server. We run all of this inside of a Citrix environment. I have a macro which runs a dozen or so queries and macros. At the end of the...
1
by: \Ji Zhou [MSFT]\ | last post by:
Hello Jason, Thanks for using Microsoft Newsgroup Support Service, my name is Ji Zhou and I will be working on this issue with you. I have tried to but cannot reproduce your issue on my side....
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
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
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
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...

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.