Setting single user mode to restore backup
问题 I have the following function: public void RestoreDatabase(String databaseName, String backUpFile, String serverName, String userName, String password) { SqlConnection.ClearAllPools(); ServerConnection connection = new ServerConnection (serverName, userName, password); Server sqlServer = new Server(connection); Restore rstDatabase = new Restore(); rstDatabase.Action = RestoreActionType.Database; rstDatabase.Database = databaseName; BackupDeviceItem bkpDevice = new BackupDeviceItem (backUpFile