Vinicius Guerrero
Vinicius Guerrero

Reputation: 13

Entity Framework Data First - Invalid Object Name dbo.TableName

sup? I got this problem wich has been slowing down my production a lot, hope u guys can give me any tip on how to solve it....

I'm currently using EF6 and a custom ConnectionString with a connectionString builder class that reads and external xml file.

My database is all set up and running in SQL 2010 and Management Studio ok, but whenever I generate the edmx file, it generates the class mappings okay, I've compared the original ConnectionString to my ConnectionString Builder they're the same, changed the :base to receive a custom ConnectionString, all set.

But when I try to save changes it doesn't find the table object, I have deleted it, created again from the start, still same "Invalid database object Dbo.TableName" error.

Does any one have a clue on this? Thanks in Advance!

Upvotes: 0

Views: 555

Answers (1)

Jonathan Magnan
Jonathan Magnan

Reputation: 11327

This error is not coming from Entity Framework but directly from the database.

Use SQL Profiler and include in the trace the "DatabaseName" and "ServerName" and you will find out it's not the same as your expected.

The only other options which this issue happen is if your "tableName" is not the same as the table name in SQL, so run the SQL from the SQL Profiler directly into SSMS.

Upvotes: 1

Related Questions