Click here to Skip to main content
11,922,641 members (57,060 online)
Rate this:
Please Sign up or sign in to vote.
See more: C#
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 20-Mar-13 2:31am
Yep. A 5!
Thank you, Prasad.
udusat13 20-Mar-13 2:46am
Thanks for your reply.but please explain.
Sure. What part of it do you want me to explain? Do you know how to handle events? This is all what matters.
udusat13 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 ?
I would suggest XML. Please read this:
Menon Santosh 20-Mar-13 3:37am
Nice Solution
Thank you, Menon.
Probably, this is the only one, is it not?
Menon Santosh 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)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.151125.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