

You can add more parameters to build your connection string. You can either use the new operator to make that directly.įor example: SqlConnection conn = new SqlConnection( SqlConnection conn = new SqlConnection(sConnB.ConnectionString) Then you can get the connection string from the ConnectionString property from the SqlConnectionStringBuilder object, as is shown in this example:įor example: SqlConnectionStringBuilder sConnB = new SqlConnectionStringBuilder () To build the connection string, you need to instantiate an object from that SqlConnectionStringBuilder and set their properties with the parameters you use to connect to the database.

Actually you can use the SqlConnectionStringBuilder class to build your connection string.
