I cannot get Entity Framework to work with SQL Azure. Is it just me or not intended for compatibility? (I tried the original version of EF with VS2008, as well as the newer version of VS2010 Beta 2)
To test this, I created the simplest script. Add a separate table to the local instance of SQL Server 2008. The table has two columns, an integer primary key and a row column. I add one row to the table with the values (1, foobar). Then I added the exact same setup to the Azure SQL Database.
Created a console application and generated an EF model from a local database. Launch the application, and all is well, one line can be returned from a trivial request. Update the connection string to connect to SQL Azure, and now it fails. It connects to the Azure SQL database without problems, but the query is not executed when processing the result.
I tracked the original problem using exception information. In the conceptual model, the Schema = "dbo" attribute was set for a set of objects of my only specific object. I removed this attribute and now it fails with another error ...
"Invalid object name 'testModelStoreContainer.Test'."
Where "Test" is, of course, the name of the entity that I defined, and therefore it looks like it is trying to create an object from the returned result. But for some unknown reason this trivial scenario cannot solve.
So, am I either making a fundamental mistake, or is SQL Azure incompatible with EF? And it seems to me just crazy. I want to use EF in my WebRole and then RIA Services for the Silverlight client.
source share