I am maintaining an existing (and working) C# project which uses Entity Framewwork 6
to do the ORM. Now I need to migrate the database from MySQL
to SQL Server
. So far I have been able to make the program compile by modifying the .edmx
file (For example, I changed the Provider
from MySql.Data.MySqlClient
to System.Data.SqlClient
and ProviderManifestToken
from 5.6
to 2008
. Also I needed to change some data types in the ssdl content, for example from double to float).
Now when I run a simple LINQ
query against the ObjectContext
-derived context like this:
var query = from data in context.user select data;
var users = query.ToArray();
It gives me the exception "Invalid object name 'MYDBNAME.user'."
Apparently a ".dbo" is missing, i.e., the translated SQL query should be
select * from MYDBNAME.dbo.user
instead of
select * from MYDBNAME.user
But I am not sure how I can instruct EF to add the ".dbo". Is there some configuration/option to do that?