Is there a way to use SMO to disconnect all active users from a SQL database, so I can perform a database restore?
The question linked to below is similar, but does not discuss the use of SMO.
When restoring a backup, how do I disconnect all active connections?
This link also is a similar question, but remains unanswered:
http://us.generation-nt.com/answer/smo-detach-fails-due-active-connection-help-122972951.html