Click here to Skip to main content
13,868,417 members
Rate this:
Please Sign up or sign in to vote.
See more: , +
I Have Two Entity in MYSQL Using Entity Framework 6.1.3v

This is My Configuration File Relative Content

    <add name="db_aia_rcsEntities" connectionString="metadata=res://*/DB.AIAEntitiesMySQL.csdl|res://*/DB.AIAEntitiesMySQL.ssdl|res://*/DB.AIAEntitiesMySQL.msl;provider=MySql.Data.MySqlClient;provider connection string="server=localhost;user id=root;database=db_aia_rcs"" providerName="System.Data.EntityClient" />
    <add name="aia_ursEntities"    connectionString="metadata=res://*/DB.ModelUrs.csdl|res://*/DB.ModelUrs.ssdl|res://*/DB.ModelUrs.msl;provider=MySql.Data.MySqlClient;provider connection string="server=localhost;user id=root;persistsecurityinfo=True;database=aia_urs"" providerName="System.Data.EntityClient" />
    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
        <parameter value="v12.0" />
      <provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices" />

When Run the System I got This Error
Screen Shot Here

Thank In Advance!

What I have tried:

I Delete And Re Create Two Models But get the Same Error No Luck
Updated 11-Jul-18 23:29pm

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

I haven't tried using MySQL with EF, but I hope this short discussion helps: Enity Framework With MySQL - Stack Overflow[^]

You can also check this documentation on how to properly connect MySQL with EF6: MySQL :: Connectors and APIs Manual :: 5.8.1 Entity Framework 6 Support[^]
Manoj Chamikara 12-Jul-18 5:12am
Thank You I got the answer in MySQL Documentation you gave
Thank You For Your Valuable Time

Final Code looks like this
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework"/>
<provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.Entity.EF6"/>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer"/>

Vincent Maverick Durano 12-Jul-18 8:47am
Awesome! Glad to be of help! :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Cookies | Terms of Service
Web06 | 2.8.190214.1 | Last Updated 12 Jul 2018
Copyright © CodeProject, 1999-2019
All Rights Reserved.
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100