In this article I will explain how to use MS SQL Management Objects (SMO) to create a MS SQL database from C# code. In this sample will
- Enumerate all the SQL servers in the network and fill a list box where the user can select one of the servers.
- The user will enter the Database Name to create.
- The user will enter an AD account to grant right to.
- When the user click "Create Database" the system will check for the existence of the database.