Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / December 2007

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Carmine [www.thetotalsite.it] - 30 Nov 2007 22:49 GMT
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
Carmine [www.thetotalsite.it] - 01 Dec 2007 13:27 GMT
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?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.