I have this code snippet that creates backup of db:
try
{
string connStr = "<valid connection string>";
using (SqlConnection conn = new SqlConnection(connStr))
{
conn.Open();
string sqlStmt = String.Format("BACKUP DATABASE InventoryDB TO DISK='{0}'",
DBBackupSaveFileDialog.FileName);
using (SqlCommand bu2 = new SqlCommand(sqlStmt, conn))
{
bu2.ExecuteNonQuery();
}
...
problem is that it works fine on developer pc but when i try on different machine it will give this error
Cannot open backup device 'C:\User\Saleh\Documents\12.bak'. Operating system error 5 (failed to rerieve text for this error. Reason: 15105).