سلام
من این کد رم برای restore بانکم مینویسم :
SqlCon.Open();
SqlCom.CommandText = "RESTORE DATABASE Test FROM DISK='c:\\dbBackup.bak'";
SqlCom.Connection = SqlCon;
SqlCom.ExecuteNonQuery();
SqlCon.Close();
ولی خطا میده :
Exclusive access could not be obtained because the database is in use.
RESTORE DATABASE is terminating abnormally.