Click here to Skip to main content
15,877,857 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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 22:29pm

1 solution

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[^]
Share this answer
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)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900