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

7
  • 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. Commented Nov 3, 2020 at 10:15
  • Does this answer your question? Table 'DBNAME.dbo.TableNAME' doesn't exist Entity Framework 6 with MySQL Commented Nov 3, 2020 at 10:29
  • unfortunately i think different problem here @MortezaAsadi Commented Nov 3, 2020 at 10:32
  • Please add your DbContext here to solve your problem. Commented Nov 3, 2020 at 10:33
  • @MuratSaygılı I'll repeat my question :) : Have you set a schema somewhere in your modelbuilder? Commented Nov 3, 2020 at 11:56

1 Answer 1

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
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.