Friday, May 11, 2007

DbConnectionStringBuilder and the property grid control

This may be obvious to some but it wasn't to me so I thought I'd write about it.  Recently I discovered a problem with our implementation of DbConnectionStringBuilder.  Whenever you changed a field that took a string (i.e. character set or server), the connection string property would not update.  I know the changes were applied because I developed a test application that queried the connection string.  It was correct even though the UI of the property grid was not. 

After an embarrassingly long time working on this I emailed a friend of mine who I felt would know the answer.  Turns out he didn't but he knew someone who did and not more than 30 minutes after talking with him I had my answer.  Each property of MySqlConnectionStringBuilder needs to be decorated with the RefreshPropertiesAttribute.  This causes the property grid to refresh itself when they change.

6 comments:

  1. Wholesale replica handbagsJune 15, 2009 at 4:17 PM

    This causes the property grid to refresh itself when they change.

    ReplyDelete
  2. Wholesale replica handbagsJune 15, 2009 at 4:17 PM

    developed a test application that queried the connection string. It was correct even though the UI of the property grid was not.

    ReplyDelete
  3. panama real estateJuly 10, 2009 at 11:27 AM

    Very nice post. Even if the post does not really make sense right now to me, because I am just a beginner in programming world, but it is nice to read and know different application, codes and other things related in programming. Thanks

    ReplyDelete
  4. Christian AudigierJuly 13, 2009 at 8:53 PM

    Very interesting topic will bookmark your site to check if you write more about in the future.

    ReplyDelete
  5. Baby Shower FavorsJuly 14, 2009 at 12:18 AM

    Thanks for sharing this excellent information on the implementation of dbConnectionStringBuilder together with the property grid control. This content is very beneficial to me as a learner.

    Cheers, Yameer, Baby Shower Favors

    ReplyDelete
  6. Good post! Our custom research paper writing service masterpapers.com seeks to boost your intellectual abilities and prove to your supervisor that you are on the right program. With a team of PhD and MA experts on board, you will get a tailored thesis that meets all the required specifications.

    ReplyDelete