C# Backing up data to file which can be restored later
I'm looking for some feedback as to what is the best way to back data up from a sql server database which can be restored at a later date. This back up needs to be in a file which the user can use to restore data at a later date.
开发者_JS百科Does anyone have any ideas or examplea as to the best way to do this using C# and Sql Server?
EDIT: This shouldn't back the whole database, just a set of data specified by the user using dates.
Thanks
If I understand properly, you want to audit just some of your data for changes (as opposed to having a full DB backup) and to be able to selectively roll them back to a previous state.
If that's what you want to do, you may do that from within sql by using a "audit" table and populating it via triggers on the table where your original data is stored (i.e. each time a row is inserted/updated/deleted the trigger will write on the "audit" table what the previous value was and when it was changed).
See here for an example.
Try this bit of Code. i have used this before.
http://www.daniweb.com/forums/thread202843.html
精彩评论