Click here to Skip to main content
15,901,035 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello To Every Body.

Please Help me.

I use c# 2008 and SQL server express 2005 For connect my database to c# I use LINQ

Now I want to understand How can I Backup And Restore My Database ?


It is So necessary Please Help Me


Thank you Every Body.


Hamed From Iran.
Posted

I don't believe that you can either backup or restore an SQL database with Linq - but it is pretty easy to do with SQL: there is an example here http://techpint.com/programming/sql-server-backup-and-restore-database-using-t-sql[^]
 
Share this answer
 
Hi,

You can take backup to your database through sql server. Later you can restore it.

For Backup:

SQL
BACKUP DATABASE myDB
TO DISK='C:\myDB.bak'
WITH DESCRIPTION='Database Backup',
INIT,
PASSWORD='myPwd'



For Restore :

SQL
RESTORE DATABASE myDB
FROM DISK='C:\myDB.bak'
WITH PASSWORD='myPwd'
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900