Error: "Column 'InvariantName' is constrained to be unique. Value 'MySql.Data.MySqlClient' is alre

  • Thread starter Carmine [www.thetotalsite.it]
  • Start date
C

Carmine [www.thetotalsite.it]

Hi,
I am using ASP.Net 2.0 with the MySQL Connector .Net 5.1.2.2.
I added these lines to the web.config to make the connector.net able to
handle the SqlConnection object (and so to bind it to a grinview/formview
etc.):

<DbProviderFactories>
<add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient"
description=".Net Framework Data Provider for MySQL"
type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data,
Version=5.1.2.2, Culture=neutral, PublicKeyToken=C5687FC88969C44D"/>
</DbProviderFactories>

The application works perfectly in local when I test it through Visual
Studio 2005.
But, on the web site, I get this error:

Column 'InvariantName' is constrained to be unique. Value
'MySql.Data.MySqlClient' is already present.

It's probably due to the fact that a previous version of the MySql
Connector.net is installed in the GAC of the web server... but I want to use
the binary located in the /Bin directory of my application.

How can I solve this problem?

Thanks in advance,
Carmine
 
C

Carmine [www.thetotalsite.it]

Nobody?

Furthermore, here is the machine.config:

<system.data>
<DbProviderFactories>
<add name="Odbc Data Provider" invariant="System.Data.Odbc"
description=".Net Framework Data Provider for Odbc"
type="System.Data.Odbc.OdbcFactory, System.Data, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<add name="OleDb Data Provider" invariant="System.Data.OleDb"
description=".Net Framework Data Provider for OleDb"
type="System.Data.OleDb.OleDbFactory, System.Data, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<add name="OracleClient Data Provider"
invariant="System.Data.OracleClient" description=".Net Framework Data
Provider for Oracle" type="System.Data.OracleClient.OracleClientFactory,
System.Data.OracleClient, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089" />
<add name="SqlClient Data Provider" invariant="System.Data.SqlClient"
description=".Net Framework Data Provider for SqlServer"
type="System.Data.SqlClient.SqlClientFactory, System.Data, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient"
description=".Net Framework Data Provider for MySQL"
type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data,
Version=5.1.3.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
<add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient"
description=".Net Framework Data Provider for MySQL"
type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data,
Version=5.0.8.1, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
</DbProviderFactories>
</system.data>

As I see, there are two same invariant name, one for the 5.1.3.0 version of
MySQL and one for the 5.0.8.1.
How can I remove an invariant name from my application with no edit of the
machine.config?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top