471,325 Members | 1,450 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,325 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 2225
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Tim | last post: by
23 posts views Thread by pamelafluente | last post: by
20 posts views Thread by David Levine | last post: by
1 post views Thread by \Ji Zhou [MSFT]\ | last post: by
reply views Thread by rosydwin | last post: by

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.