Connection String magic with Whidbey

Within the System.Data.Common namespace is the DbConnectionStringBuilder class.  This class allows you to manage and easily parse the connection string to make changes as necessary within your application.  Why would you want to do this?  Well, you might have a database management application and want to change values within the connection string so that you can easily make move between one database session and another.  This class is very cool.  Check it out.

Wally

3 Comments

  • Why would you want to do this? Why WOULDN'T you want to do this? Connection strings are so non-OO I am amazed they are still around. Imagine if every other object in the .NET framework took a string of key-value pairs delimited with ; characters as part of their constructor, where each key corresponded to a property but did not actually have the same name as the property, and where the same property could be assigned with multiple "keys".

  • What's the difference between this DbConnectionStringBuilder class and the DBConnectionString class in .NET v1.1 ?

  • Sorry - DbConnectionString is an internal class in the System.Data.Common namespace in v1.1 so you can't access it (yet).

Comments have been disabled for this content.