The SqlConnectionStringBuilder, only allows to you to generate a SQL Server compliant Connection-String, to open or close a Connection you need to create a new SqlConnection and adding the generated Connection String. For example:
SqlStringBuilder sb = new SqlStringBuilder(); // Sets the respective properties using (SqlConnection cnn = new SqlConnection(sb.ToString())) { cnn.Open(); /// Create a command and execute it cnn.Close(); }
Regards
|