SqlConnectionStringBuilder sqlb = new SqlConnectionStringBuilder();
sqlb.DataSource = "ip address";
sqlb.InitialCatalog = "databasename";
sqlb.UserID = "username";
sqlb.Password = "password";
sqlb.IntegratedSecurity = false;
sqlb.Pooling = true;
SqlConnection conn = new SqlConnection();
conn.ConnectionString = sqlb.ConnectionString;
conn.Open();
conn.Close();