当我使用给定的代码从该文件进行备份和恢复时,它会成功恢复,但是当我删除任何表的某些行并从同一个备份文件恢复我的数据库时,它会给出错误
“你调用的对象是空的”
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
cmd2 = new SqlCommand("USE MASTER RESTORE DATABASE plproject FROM DISK = '" + openFileDialog1.FileName + "' WITH REPLACE", Con);
dr = cmd1.ExecuteReader();
//cmd2.ExecuteNonQuery();
dr.Dispose();
MessageBox.Show("Database Restored", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
}