本文介绍了还原数据库时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
try
{
gn.open();
string str;
str = @"RESTORE DATABASE bw FROM DISK = 'C:\SQLBackup\bw.bak'";
SqlCommand cmd = new SqlCommand(str, gn.cn());
cmd.ExecuteNonQuery();
}
我尝试了上述编码以使用Windows应用程序还原数据库.
i tried above coding to restore database using windows application ., i am getting error like.,
restore cannot process database 'bw' because it is in use by this session. it is recommended that the master database be used when performing this operation.
restore database is terminating abnormally
>
推荐答案
这篇关于还原数据库时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!