Table 'dbname.dbname.tablename' doesn't exists error in Visual Studio when adding Mysql Entity Framework

こ雲淡風輕ζ 提交于 2021-01-28 12:44:41

问题


I am trying to add MySQL with Entity Framework in Visual Studio. I am using MySQL Server 8.0.12 and also the 8.0.12 Connector/MySql.data. error: MysqlException: Table 'dbname.dbname.tablename' doesn't exists. Normally I have table but dbname name showing twice.

My code's very simple, I want to list all datas in my table:

 using (sakilaEntities db = new sakilaEntities())
 {
     var list =  db.country.ToList();
 }

I'm getting below error.

UPDATE: Uninstall MySQL Server 8.0.12 and MySQL Connector 8.0.12 then install MySQL Server&Connector 8.0.19. Add below code in your web config.

<providers>
      <provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.EntityFramework, Version=8.0.19.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
      <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
</providers>

来源:https://stackoverflow.com/questions/64894690/table-dbname-dbname-tablename-doesnt-exists-error-in-visual-studio-when-addin

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!