tags:

views:

20

answers:

1

Hi everyone, I need a C# program to read the a record (stored in various tables) from the database and store it in the File System (in some format) and remove the record from the database. In other words, archiving database record on File System. It is also required to restore this record back when needed. So how can i achieve this? In which format I gonna go to store the data in File System. How can i restore it back when needed.

PS: My data is stored in various different tables and data types are int, text, varchar, datetime, images.

+1  A: 

It may make sense to load the data into a DataSet and then use .Net's built-in XML functionality to save the result to disk as an XML file.

You could then simply load the DataSet from the XML and persist back to the database.

See this and this article for example.

Antony Koch