Change the Access Mode of a database
My need is to make a access mode of a p开发者_C百科articular database to Single for data movement from one database to another database by using an application on which website is running so that at the time of no other user can modify that database.
This all thing i like to do through C# Code i.e. before running Insert/Update queries I like to execute query for making the destination database not usable by any other user. If there is any connection available with that database then I like to close it.
Check out SQL Management Objects, it allows you to control the meta data of the DB server in an OO way. You can do things like Backup, killing connections, etc. You could also issue the relevant SQL commands over a connection to do what you want.
精彩评论