سلام
نه موقع backup گیری ارور نمیده و restore را با کد
string command = "ALTER DATABASE Pubs SET SINGLE_USER with ROLLBACK
IMMEDIATE " +
"use master " +
" RESTORE DATABASE Pubs FROM DISK='" + strFileName + "'";
this.Cursor = Cursors.WaitCursor;
SqlCommand oCommand = null;
SqlConnection oConnection = null;
oConnection = new SqlConnection("Data Source=.;Initial
Catalog=Pubs;Integrated Security=True");
if (oConnection.State != ConnectionState.Open)
oConnection.Open();
oCommand = new SqlCommand(Sqlcommand, oConnection);
oCommand.ExecuteNonQuery();
this.Cursor = Cursors.Default;
نوشتم
خطا
Invalid zero-length device name. Reissue the BACKUP statement with a valid device name.
RESTORE DATABASE is terminating abnormally.
Changed database context to 'master
و
بعضی اوقات خطا میده که نمیتونه دیتابیس رو باز کنه
با تشکر





پاسخ با نقل قول
