string server = textBox_Server.Text;
ServerConnection srvConn = new ServerConnection(server);
// Log in using SQL authentication instead of Windows authentication
srvConn.LoginSecure = false;
// Give the login username
srvConn.Login = textBox_userName.Text;
// Give the login password
srvConn.Password = textBox_Password.Text;
// Create a new SQL Server object using the connection we created
srvSql = new Server(srvConn);
我可以看到现有的数据库及其信息。
Database myDatabase = new Database(srvSql, "MyNewDatabase");
myDatabase.Create();