Hi,
I'm using Enterprise Library 4.1.
I have a new feature to implement and it requires the use of mysql.
I have found Enterprise Library Contrib, which adds functionalities to use MySQL with Enterprise Lib.
Works great.
To get it to work, you need to call the method 'DatabaseFactory.CreateDatabase(connectionStringName);' like you would normally do. The connection string name is stored in the configuration and linked to the database provider mapping configuration section.
As an exemple:
<dataConfiguration defaultDatabase="MyDefaultDb">
<providerMappings>
<add databaseType="EntLibContrib.Data.MySql.MySqlDatabase, EntLibContrib.Data.MySql, Version=4.1.0.0, Culture=neutral, PublicKeyToken=null"
name="MySql.Data.MySqlClient" />
</providerMappings>
</dataConfiguration>
<connectionStrings>
<add name="MyDefaultDb"
connectionString=""
ProviderName="System.Data.SqlClient" />
<add name="acb_leaderboards"
providerName="MySql.Data.MySqlClient"
connectionString="" />
</connectionStrings>
Unfortunately, my application will connect to multiple MySQL database and the conncetion will vary from time to time. I can't have the mysql connection string be specified in the configuration.
I want to create a MySQL database object based on the providerMapping configuration.
How can I do that?
Thank you.
PS. English is not my first language, I'm trying my best.