Solved

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

Posted on 2004-08-31
6
283 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
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 
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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
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…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

813 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now