Solved

how can i detect if changes have been made to my dataset

Posted on 2004-08-31
6
290 Views
Last Modified: 2010-04-23
hi , i have a form with a datagrid, which is bound to a dataview, i want to write a procedure when the form_closing
event happens.
if there are any changes made to the dataset (the datagrid bound dataset /dataview)
then notify the user.
how can  i detect this, any sample links?
i did try the microsoft concurrency link
http://msdn.microsoft.com/library/default.asp?url=/msdnmag/issues/03/04/DataConcurrency/TOC.asp
but it didnt help me, im on ms access
thanks!
0
Comment
Question by:jxharding
  • 3
  • 3
6 Comments
 
LVL 25

Accepted Solution

by:
RonaldBiemans earned 500 total points
ID: 11939999
You mean yourdataset.haschanges  this return true or false ?
0
 

Author Comment

by:jxharding
ID: 11940090
hi rondal, thats the one ,thanks,
in which form event can i use it, it seems closing and closed events are too late
0
 
LVL 25

Expert Comment

by:RonaldBiemans
ID: 11940121
Hi jxharding,

Why are they to late ?
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 25

Expert Comment

by:RonaldBiemans
ID: 11940142
maybe look at this code

Private Sub Form1_Closing(sender As Object, e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
   ' Determine if text has changed in the textbox by comparing to original text.
   If textBox1.Text <> strMyOriginalText Then
      ' Display a MsgBox asking the user to save changes or abort.
      If MessageBox.Show("Do you want to save changes to your text?", "My Application", MessageBoxButtons.YesNo) = DialogResult.Yes Then
         ' Cancel the Closing event from closing the form.
         e.Cancel = True
      End If ' Call method to save file...
   End If
End Sub 'Form1_Closing
End Class 'Form1
0
 

Author Comment

by:jxharding
ID: 11940143
the plan up to right now was  to execute this little piece of code,
  If Ds1.HasChanges = True Then
            MessageBox.Show("Update!")
            Exit Sub
 End If

and this would (supposed to have) allow the user to return to the form.
but now that you mention it, i prob should just put a dialogbox with a Yes and No button, asking the user if he wants to save.
0
 

Author Comment

by:jxharding
ID: 11940149
saved again!,brilliant, thanks!
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

791 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question