Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / August 2006

Tip: Looking for answers? Try searching our database.

Dataset State

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
MarkusR - 14 Aug 2006 14:59 GMT
I want to prevent the user from closing the application if they are in
the middle of entering data. Is there a way to detect this?
Bala - 14 Aug 2006 15:10 GMT
There are a couple of events you could try to catch.
The "FormClosing" event for starters..

> I want to prevent the user from closing the application if they are in
> the middle of entering data. Is there a way to detect this?
MarkusR - 15 Aug 2006 18:41 GMT
Thanks Bala but I know where to check but I don't know what to check.

How do I detect the state of the table?

-Markus

> There are a couple of events you could try to catch.
> The "FormClosing" event for starters..
>
> > I want to prevent the user from closing the application if they are in
> > the middle of entering data. Is there a way to detect this?
MarkusR - 21 Aug 2006 20:24 GMT
Is this a new concept?

Does no one validate whether the user wants to save/cancel changes when
the form is closing?

-MarkusR

> Thanks Bala but I know where to check but I don't know what to check.
>
[quoted text clipped - 7 lines]
> > > I want to prevent the user from closing the application if they are in
> > > the middle of entering data. Is there a way to detect this?
Simon Tamman - 22 Aug 2006 01:00 GMT
Depends what your datasource is.
If it's a dataset you can call DataSet.GetChanges() to get any changes (e.g.
if there are no changes than the user hasn't modified any data).
This method obviously co-incides with the functionaliy of the
AcceptChanges() method of the dataset and row and table state (New,
Modified, Unchanged, Deleted etc).

HTH

Simon

> Is this a new concept?
>
[quoted text clipped - 14 lines]
> > > > I want to prevent the user from closing the application if they are in
> > > > the middle of entering data. Is there a way to detect this?
MarkusR - 22 Aug 2006 18:58 GMT
Thanks Simon,

I am used to delphi where it is very event driven. BeforePost,
AfterPost, BeforeInsert....
Dataset.State = dsEdit..., tabpage.changing (so you can prevent it)...

Got spoiled.

C# is great though, so no need to start a delphi vs c# war. Just give
me a chance to adjust.

-Markus_R

> Depends what your datasource is.
> If it's a dataset you can call DataSet.GetChanges() to get any changes (e.g.
[quoted text clipped - 26 lines]
> in
> > > > > the middle of entering data. Is there a way to detect this?
Simon Tamman - 22 Aug 2006 20:55 GMT
No worries, no need to start a Delphi-C# war, Eric Gunnarson worked on
creating both C# and Delphi so it's almost like we're family. :)

> Thanks Simon,
>
[quoted text clipped - 39 lines]
> > in
> > > > > > the middle of entering data. Is there a way to detect this?
MarkusR - 31 Aug 2006 21:21 GMT
I miss my numbered bookmarks as in Delphi. :(

> No worries, no need to start a Delphi-C# war, Eric Gunnarson worked on
> creating both C# and Delphi so it's almost like we're family. :)
[quoted text clipped - 46 lines]
> > > in
> > > > > > > the middle of entering data. Is there a way to detect this?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.