Click here to Skip to main content
15,888,984 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
Hi....
How to download or backup hosted Sqlserver database which is used for a website in asp.net using c#? Is there any direct download methods?
Posted

you can try this query :

SQL
USE YourDatabaseName;
GO
BACKUP DATABASE YourDatabaseName
TO DISK = 'C:\YourDatabaseName.Bak'
   WITH FORMAT,
      MEDIANAME = 'MyBackup',
      NAME = 'Full Backup';
GO


replace YourDatabaseName with the name of your database name. It will create a bak(Back up file) file at C:\\.
For more information you can refer Database back up[^]
 
Share this answer
 
v2
Comments
Neha Thanka 26-Aug-11 9:17am    
I tried the above code.But an error occurred as follows.
"BACKUP DATABASE permission denied in database 'acemiddle'. BACKUP DATABASE is terminating abnormally."
How to solve this problem?
If you are talking about backing up the database on the hosting provider's server, you cannot directly backup the database to your local storage. Instead, you can backup your database using the BACKUP command on to the server storage and then FTP the backup file from the server to your local storage.
 
Share this answer
 
Comments
Neha Thanka 26-Aug-11 2:21am    
I have no idea to use the BACKUP command. Can you please help me?

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