The ADO.NET team is working on a building an object called SqlConnectionStringBuilder. The object is intended to assist in building connections string. Pretty basic concept and if you use config files to store your connection strings, you may not take advantage of it (but still could). But if you are writing code that concatenates strings into a connection string, you might want to check out this blog by Sushil Chordia from the ADO.NET team. pretty cool stuff!

The code would work like this:

SqlConnectionStringBuilderpublic void AccessData(string serverName, string uid, string pwd)
    SqlConnectionStringBuilder sqlConStrBldr = new SqlConnectionStringBuilder();
    sqlConStrBldr.DataSource = serverName;
    sqlConStrBldr.UserID = uid;
    sqlConStrBldr.Password = pwd;
    SqlConnection cn = new SqlConnection (sqlConStrBldr.ConnectionString);

On a scale of 1 - 5, WOW! factor of  2. But still very useful. Sometimes simple is better!

<P class=MsoNormal style=”MARGIN: 0in 0in 0pt”> </P>