Trouble with MySql integration

Sep 13, 2010 at 2:07 AM


  I'm trying to integrate Enterprise Library Contrib v4.1 Jan 2010 with my project and am running into some issues.  I can't find a good integration guide and have been trying to sort this out for a few days to no avail.  I'm using Enterprise Library v4.1 and MySql Connector v6.0.7.0.  I'm working on it and the errors are changing a little with new variations that I try out.  Am I doing anything wrong below?
  Any help is greatly appreciated.


  Here's a sample of the code that I'm trying to execute to connect to MySql and return an int value (the sp Test just returns the integer 1)

        Database db = DatabaseFactory.CreateDatabase("db");
        return Convert.ToInt32(db.ExecuteScalar("Test"));  

  Below are the relevant parts of my web.config:

    <section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, Microsoft.Practices.EnterpriseLibrary.Data, Version=, Culture=neutral" />    
<section name="enterpriseLibrary.ConfigurationSource" type="Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ConfigurationSourceSection, Microsoft.Practices.EnterpriseLibrary.Common, Version=, Culture=neutral" />

  <dataConfiguration defaultDatabase="db">
<add databaseType="EntLibContrib.Data.MySql.MySqlDatabase, EntLibContrib.Data.MySql"
        name="MySql.Data.MySqlClient" />    </providerMappings>
    <add name="db" connectionString="server=xxx;port=xxx;database=xxx;uid=xxx;pwd=xxx;"
      providerName="MySql.Data.MySqlClient" />

Sep 13, 2010 at 2:33 AM

Of course, now that I posted for help, I figured it out.  
The problem is that EntLibConfig required MySql connector v6.0.3.0.  I'm not sure why I needed to do this but it works now.  
I'd previously used v6.0.7.0 but also downloaded the EntLibConfig source and changed the references to v6.0.7.0 so I'm not sure why I needed to use v6.0.3.0.  However, it works now.