Click here to Skip to main content
13,703,835 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

<connectionStrings>
    <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" />
  </connectionStrings>
  <entityFramework>
    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
      <parameters>
        <parameter value="v12.0" />
      </parameters>
    </defaultConnectionFactory>
    <providers>
      <provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices" />
    </providers>
  </entityFramework>


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
Posted 11-Jul-18 21:34pm
Updated 11-Jul-18 22:29pm

1 solution

Rate this: bad
 
good
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[^]
  Permalink  
Comments
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
<entityframework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework"/>
<providers>
<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
Web01-2016 | 2.8.180920.1 | Last Updated 12 Jul 2018
Copyright © CodeProject, 1999-2018
All Rights Reserved.
Layout: fixed | fluid

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