how to make a database backup from localdb using RRS feed

  • Question

  • How can i make a dababase backup of localdb without using Sql server,Just Using visual studio local db .

    Can I do that. If so than please give some useful help .


    Monday, March 3, 2014 1:17 PM


  • You can use the Microsoft.SqlServer.Management.Smo dll.

    It's straight forward:

     string serverName = "localhost";
                string dbName = "myDB";
                Server server = new Server(serverName);
                Database db = server.Databases[dbName];
                Backup backup = new Backup();
               /*Add settings to backup, similar to what you would use in Sql Management Studio*/

    Monday, March 3, 2014 2:20 PM