using Microsoft.SqlServer.Management.Common;
using Microsoft.SqlServer.Management.Smo;
ServerConnection conn = new ServerConnection();
conn.ServerInstance = servername.Text;
conn.LoginSecure = false;
conn.Login = txtUser1.Text;
conn.Password = txtPassword1.Text;
server1 = new Server(conn);