Archive for May, 2007

Connector/Net 5.0.7 has been released

Hi,

MySQL Connector/Net 5.0.7 a new version of the all-managed .NET driver for MySQL has been released.

This is a bug fix release for the current production branch of Connector/Net.

Version 5.0.7 is suitable for use with any MySQL version including MySQL-4.1, MySQL-5.0, MySQL-5.1 beta or the MySQL-6.0 Falcon “Preview”.

It is now available in source and binary form from the Connector/Net download pages at http://dev.mysql.com/downloads/connector/net/5.0.html and mirror sites (note that not all mirror sites may be up to date at this point of time – if you can’t find this version on some mirror, please try again later or choose another download site.)

Bugs fixed

  • Bug #27269 MySqlConnection.Clone does not mimic SqlConnection.Clone behavior
  • Bug #27289 Transaction is not rolledback when connection close
  • Bug #26147 “User Id” problem during connection creation
  • Bug #27240 Property value characterset not retrieved/fetched in conn wizard
  • Bug #25947 CreateFormat/CreateParameters Column of DataTypes collection incorrect for CHAR
  • Bug #27765 Logging does not work
  • Bug #27679 MySqlCommandBuilder.DeriveParameters ignores UNSIGNED flag
  • Bug #27668 FillSchema and Stored Proc with an out parameter
  • Bug #28167 Poor performance building connection string (thanks Maxim!)
  • Bug #26041 Connection Protocol Property Error in PropertyGrid Control
  • Bug #26754 EnlistTransaction throws false MySqlExeption “Already enlisted”
  • Bug #23342 Incorrect parsing of Datetime object for MySQL versions below 4.1

Other changes

  • Installer now works if XML comments are found in machine.config
  • GetSchema will now attempt to unquote identifiers passed in as restrictions
  • The MySqlCommand object now properly clones the CommandType and CommandTimeout properties

Thanks for trying out this release.

Reggie

MySQL

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.

Retrieving autoincrement field values

Often people ask me how to retrieve the value of an autoincrement column when they are using the MySqlCommandBuilder object.  Generally this is done by appending something like “;SELECT last_insert_id()” onto the generated insert command text.  Command builder objects usually provide some type of syntax where a user can indicate that they want this to be done.  Connector/Net 1.0 had some syntax for this but starting with Connector/Net 5.0 that all changed. 

With the new ADO.Net 2.0 API, Microsoft did not directly provide for any type of API that users could use for selecting this.  With ADO.Net 2.0, there are two things that need to happen.  First, a SELECT statement similar to above must be attached to the INSERT command.  Second, the command object must have its UpdatedRowSource property set to Both or FirstReturnedRecord.  What this does is tell the data adapter update engine to take the first returned row and merge it’s values back into the changed row.  So, if the first returned row is the result of a ‘SELECT last_insert_id()’, then the generated key will be returned and merged back in.  Good, huh?

Not so fast.  The UpdatedRowSource property exists on the command object.  The whole point of using MySqlCommandBuilder is to not mess with command objects.  Everything should be handled automatically with as little code as possible.  To this end, we’ve added a custom property to MySqlCommandBuilder called ReturnGeneratedIdentifiers.  By setting this property to true, the proper select statement will be included and the generated command object will have its UpdatedRowSource property set.

VMWare 6 rocks

So I’ve been using Virtual PC 2007 since it was released but was always frustrated with its inferior Linux support.  I don’t really understand why Microsoft drags their feet on this.  With more and more devs moving to vm only development, it’s getting easier and easier to change your host platform and still development for Windows.  I’m sure Microsoft would much rather you run Windows as your host platform and run Linux in a vm when you need.   I’ve tried VMWare Server but since I run Vista x64 as my host, that’s more pain than I really like.

Enter VMWare 6.  Sure it installs and runs on Vista x64 like a champ and performance seems great but what really blew me away was the multi-monitor support.  I’ve been using twin 19″ monitors for nearly 2 years now and I simply can’t imagine life without them.  Folks I kid you not.  It was easier to get Ubuntu running on two monitors using VMWare 6 than it was running on my actual hardware.  I installed Feisty Fawn and then followed that up by installing the VMWare tools  (which installed without a hitch).  At the final stage of the VMWare tools install, it asks me what resolution I want to use.  I gave it a reasonable response, finished with VMWare tools, and then logged off so I could restart X.  Bam, the screen jumped to some huge resolution.  Something like 3000×2000.  I hit the maximize button on the VMWare screen and the Ubuntu desktop neatly filled both my monitors.  No editing of any x config files.  No Windows desktop elements visible.  No Windows taskbar.  Nothing.  Sweetness.

Multi-monitor support is not supported in Windows Server 2003 but XP works like a champ.  VMWare 6 puts me a little bit closer to vm only development.

Thanks Jeffrey!

We just finished up our 2007 Users Conference and I’d really like to thank David Sceppa and Jeffrey McManus for presenting at the conference.  David is a program manager on the ADO.Net team at Microsoft and I had more than one person come up to me and tell me that having a Microsoft rep at the sessions really indicated that we were serious about working with Microsoft tools and that Microsoft seemed very willing to help with that.  True indeed.

Also, I really appreciated Jeffrey being willing to jump in last minute and do a presentation for us.  He does alot of traveling and presenting so I know his time is precious.  Jeffrey also recently made available a tool he wrote for generating a set of classes for a given database schema.  He calls it Cgen and you can read his announcement about it here.  Keep up the good work, Jeffrey, and thanks!