Click here to Skip to main content
15,900,816 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi All,
Can some one please help me how to do Restore and backup of Sql server database in Asp.Net C# (Web application).

Thanks,
Naveen sharma
Posted
Comments
[no name] 21-Jun-14 10:18am    
Okay.... and what specific help is it that you need? Did you do any research at all? Have you written any code? Was there some sort of a problem with your code? What was the problem?

 
Share this answer
 
try this may it will help you this Work for me in Sql Server 2012


C#
USE Database_Name
BACKUP DATABASE DataBase_Name TO DISK = File_Path WITH FORMAT,MEDIANAME = 'Z_SQLServerBackups',NAME = 'Full Backup of DataBase_Name';




and for resoring it use below query

Use Master
RESTORE DATABASE Database_Name FROM DISK = 'file_Path'
 
Share this answer
 
v2

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