アプリケーションで C# ステートメントを使用して作業したデータベースのバックアップを作成したいと考えています。
これは私のコードです:
SqlConnection con = new SqlConnection(Connection.GetConnection());
SqlCommand command = new SqlCommand();
command.CommandText = "backup database [Pharmacy Database]to disk ="+"'"+path +"'";
command.CommandType = CommandType.Text;
command.Connection = con;
con.Open();
command.ExecuteNonQuery();
con.Close();
そして私にエラーを与えます:
バックアップ デバイス 'C:/Users/Abo Sala7/Desktop' を開けません。オペレーティング システム エラー 5 (このエラーのテキストを取得できませんでした。理由:15105)。
BACKUP DATABASE が異常終了しています。