"Man T" <al**************@yahoo.com.auwrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl...
>I just wonder what is/are your practices to build the SQL Server connection
string?
Use object to build the connection string from config file or somewhere?
If you are using version 2.0 or above of the Framework, you can use the
SqlConnectionStringBuilder class. You assign values to the various
properties of a SqlConnectionStringBuilder object, and you can then extract
the completed connection string from its ConnextionString property.
This is only needed if you are going to build it on-the-fly from values
that are "found out" during runtime. If the values in the connection string
are known beforehand, it is a common practice to simply store the completed
connection string in a config file.