This is a blatant ripoff from Aaron Skonnard, but I have to quote it to get across
the idea of the post. Check this new class out, very sweet.
SqlConnectionStringBuilder
connbuilder = new SqlConnectionStringBuilder();
connbuilder.DataSource = “localhost”;
connbuilder.UserID = “someuser”;
connbuilder.Password = “somepassword”;
SqlConnection c = new SqlConnection (connbuilder.ConnectionString);
c.Open();
connbuilder = new SqlConnectionStringBuilder();
connbuilder.DataSource = “localhost”;
connbuilder.UserID = “someuser”;
connbuilder.Password = “somepassword”;
SqlConnection c = new SqlConnection (connbuilder.ConnectionString);
c.Open();
…
// do something with the connection
// do something with the connection
Links