0

I have only 1 Model and database in the solution. When I try the execute simple query like

var list=Db.table.ToList();

Give an error like

table 'dbname.dbname.table' doesn't exist

Why not dbname.table but dbname.dbname.table? I have using mysql 8.0.22 and compatible ef

  • Have you set the schema to `dbname` somewhere in your entity model builder? Schema in .net is not the same as schema in MySql. In .net, postgres and mssql it is meant as a sort of namespace. In MySql a schema often refers to the db name. So it is not the same. – Silvermind Nov 03 '20 at 10:15
  • Does this answer your question? [Table 'DBNAME.dbo.TableNAME' doesn't exist Entity Framework 6 with MySQL](https://stackoverflow.com/questions/28044340/table-dbname-dbo-tablename-doesnt-exist-entity-framework-6-with-mysql) – Morteza Asadi Nov 03 '20 at 10:29
  • unfortunately i think different problem here @MortezaAsadi – Murat Saygılı Nov 03 '20 at 10:32
  • Please add your DbContext here to solve your problem. – Morteza Asadi Nov 03 '20 at 10:33
  • @MuratSaygılı I'll repeat my question :) : Have you set a schema somewhere in your modelbuilder? – Silvermind Nov 03 '20 at 11:56
  • no bro, just now, i create a new project and just add nuget packages and the model, but same error :( @Silvermind – Murat Saygılı Nov 03 '20 at 14:14
  • I think its about version mismatch between mysql and entityframework – Murat Saygılı Nov 03 '20 at 14:15

1 Answers1

0

Take a look at solution on github

  • Install MySQL Server 8.0.16
  • Install Complete MySQL Connector.Net x86 8.0.16
  • Install this custom repacked VSIX MySQL Visual Studio
  • If after installing MySQL Visual Studio Plugin it shows warning that failed to execute comamnd devenv /updateconfiguration, then manually execute that command in Developer Command Prompt for Visual Studio 20xx with run as administrator.
  • Run this command Install-Package EntityFramework in Visual Studio Nuget package manager console
  • Manage Nuget Packages > Search Mysql > install Mysql.Data v8.0.16
  • Manage Nuget Packages > Search Mysql > install Mysql.Data.Entity v6.10.8
  • Manage Nuget Packages > Search Mysql.Data.EntityFramework > install Mysql.Data.EntityFramework v8.0.16