auto save datatable as xml periodically
I have a datatable in my windows application which will be updated by the user. I want my datatable to be saved as backup file as an xml file for every 30mins. How can this be done. I'm using VS2008.
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Sam HobbsPosted Mar 3, 2010, 1:16 PM
I was a database programmer back in the days before Microsoft existed. I am familiar with the database system that large businesses used back then. At that time, the biggest database system that IBM had would write all transactions to a log file, so there was a record of all data. The log files got written to tapes, so if the main system crashed, they would still have the data. I don't know how SQL Server server does something similar but I assume that SQL Server does have a way to retrieve transactions.
lakchanaPosted Mar 3, 2010, 2:17 AM
Amit ChoudharyPosted Feb 26, 2010, 1:12 AM
then start a thread as user starts the application and you can run it after a break of 1 min or what ever you want..
and in that thread just export your dataTable to XML using DTable.WriteXml() method.
lakchanaPosted Feb 26, 2010, 12:10 AM
Amit ChoudharyPosted Feb 25, 2010, 7:39 AM
I suggest you to do it from the Database end. not from your window application end cause if you write program for it then it'll take backup only when your application is running.
But if you want as long as the machine is powered on your data gets Backing up then you can create job and schedules in case of SqlServer.
Few lines of Some T-Sql code will do it easily.