1

Possible Duplicate:
Backup SQL Server via C#

I have a Windows Forms project which is storing some values in SQL Server 2008 R2, I have many tables in there which deals with my application.

I would like to take a database backup so that if the user is to loose the operating system and reinstall, they can restore the database using the backup (.BAK file).

I would like to know how I can take a backup from SQL Server 2008 R2 with C#, and if it's compulsory to install SQL Server in the client computer whilst taking the backup.

Also, how can I restore it? Any examples may help.

0

1 Answer 1

1

You'll need to install the client tools.

What you'll need is SMO (Sql Server Management Objects)

This provides an api to perform certain Sql Server tasks including backups

Sign up to request clarification or add additional context in comments.

2 Comments

what about the backups and restore? Can you provide me an example. I am newbie to c#, example can help, please if you can
@aquibRocks checkout this page codeproject.com/Articles/13755/SMO-Manage-your-SQL-Server the examples include backup and other tasks

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.