I am trying to create a backup of my SQL Server Database in Visual Studio 2010.
I am using the following command to back up the database:
BACKUP DATABASE Db TO DISK = 'c:\server.bak'
This is connection string that I am using.
<add name="ConnectionString" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Db.mdf;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient"/>
However, when I run the command, I get the following error message.
Database 'Db' does not exist.
Here is a screenshot that describes my error:
http://www.cs.purdue.edu/homes/aerfanfa/sqlerror.jpg
Does anyone have a solution for my problem? Thanks!