Solved

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

Posted on 2004-08-31
6
300 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

 
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

752 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