title: backing up database in visual studio c#
body: <p>I am developing a windows application using c# and inbuilt SQL Server on Visual Studio 2010.</p>
  
  <p>I am trying to create a click event to backup database to a specified location, but when I am running it, it is showing me error that database with this name doesn't exist.</p>
  
  <p>the code I am using is</p>
  
  <pre><code> SqlCommand cmd = new SqlCommand("BACKUP DATABASE GRTU_LIBRARY_MANAGEMENT TO  DISK = N'D:\temp\foo' WITH NOFORMAT, NOINIT,  NAME = N'Full Database Backup', SKIP, NOREWIND, NOUNLOAD,  STATS = 10", connect);
   cmd.ExecuteNonQuery();
  </code></pre>
  
  <p>It is showing error 
  "Database 'GRTU_LIBRARY_MANAGEMENT' does not exist. Make sure that the name is entered correctly.
  BACKUP DATABASE is terminating abnormally."</p>
  
  <p>I am using the same database in the whole application but here it is showing this error.
  I am using the inbuilt SQL server in Visual Studio 2010</p>
  
  <p>Please help</p>