I want to take database backup from server PC to client PC. I can save it into server PC, but I can’t save it into client PC.
I’m using ASP.NET and C#. Here is my DB backup code:
string Msg = null;
string FileName = "E:\\DBName.Bak"; // directory where file will be save.
SQL code:
BACKUP DATABASE standard TO DISK = '" + FileName + "' WITH FORMAT")"
A better option would be to copy the database data into an xml file then download that. This circumvents most of the security issues with messing about with SQL folder permissions that should really be left untouched.
Theres an article on my website with sample code on how to create a database backup and restore facility via an asp.net web page which dumps the data into xml files for you to download, and there is also a restore facility so you can upload your xml files again to restore data. You can have another copy of the restore facility on your local machine if you need to restore the database locally.