Click here to Skip to main content
Rate this: bad
Please Sign up or sign in to vote.
See more: C# WinForm
Hi Expert,
I am working in winform c# & sql server.
I am using datagridview (as excel ) for data entry.There is fixed structure. And storing these entries in sql server 2005.

And is working fine for me.
Now problem is , How to save temp-file like Word does when automatic shutdown,poweroff etc ,And i want to store these datagridview data as it is .
I want fastest way to save and backup. I tried in excel but working slow for me.
Please Help me to solve this problem.Thanks in adv.
And sorry for bad english.
Posted 19-Mar-13 21:26pm

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

You can do it by handling system events using the class Microsoft.Win32.SystemEvents:[^].
Prasad_Kulkarni at 20-Mar-13 2:31am
Yep. A 5!
Sergey Alexandrovich Kryukov at 20-Mar-13 2:36am
Thank you, Prasad.
udusat13 at 20-Mar-13 2:46am
Thanks for your reply.but please explain.
Sergey Alexandrovich Kryukov at 20-Mar-13 2:58am
Sure. What part of it do you want me to explain? Do you know how to handle events? This is all what matters.
udusat13 at 20-Mar-13 3:08am
How to store datagridview entries entered during powerloss and which format( like Excel,word,sql) ?
Should i use Microsoft.Win32.SystemEvents or FormClosing event ?
Sergey Alexandrovich Kryukov at 20-Mar-13 3:16am
I would suggest XML. Please read this:
Menon Santosh at 20-Mar-13 3:37am
Nice Solution
Sergey Alexandrovich Kryukov at 20-Mar-13 9:15am
Thank you, Menon.
Probably, this is the only one, is it not?
Menon Santosh at 21-Mar-13 8:22am
You are right :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Advertise | Privacy | Mobile
Web02 | 2.8.150327.1 | Last Updated 20 Mar 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100