2

I want to do a backup of my SQL Server database via my program in ASP.Net MVC 4. Please help me on where to start as I have not done it before.

Thanks in advance

Gotham Must Fall
  • 111
  • 3
  • 11

2 Answers2

1

you can use Microsoft.SqlServer.Management.Smo for back up and restore database Code Project example using .Net 2.0 .Hope this will match your requirement

Also look the same type of question Restore SQL Database using C#

Community
  • 1
  • 1
udaya726
  • 1,010
  • 6
  • 21
  • 41
1

backup is simple, you can execute sql command in entity framework:

BACKUP DATABASE YourDB TO DISK = 'C:\Backups\YourDB.bak'
Edi Wang
  • 3,547
  • 6
  • 33
  • 51