Jul 9, 2009

Entity framework Eager Loading error

If you you get this

"The execution of this query requires the APPLY operator, which is not supported in versions of SQL Server earlier than SQL Server 2005."

We ran into this because we generated it via a 2000 database and threw an error.

Load the edmx file in notepad.

<?xml version="1.0" encoding="utf-8"?>
<edmx:Edmx Version="1.0" xmlns:edmx="http://schemas.microsoft.com/ado/2007/06/edmx">
  <!-- EF Runtime content -->
    <!-- SSDL content -->
      <Schema Namespace="TableModels.Store" Alias="Self" Provider="System.Data.SqlClient" ProviderManifestToken="2000" xmlns:store="http://schemas.microsoft.com/ado/2007/12/edm/EntityStoreSchemaGenerator" xmlns="http://schemas.microsoft.com/ado/2006/04/edm/ssdl">

Now all we need to do is change the 2000 to 2005!

No comments:

Post a Comment