Question

I created an ORM using Entity Framework 5.0. I added a reference to the ORM to my ASP.NET application. I am trying to use a EntityDataSource to populate a DropDownList. I could configure the EntityDataSource without any problem. However I couldnt set the data fields for the value and the text of the DropDownBox using the wizard, if I click the "Refersh Schema" button (in the Data Source Configuration Wizard), I am getting the following error, "The schema could not be determined because of the following error from the EntityDataSource: Could not find teh CLR type for "

Was it helpful?

Solution

Try this: Change the Code Generation Strategy for your model to Default. Delete .tt files. Save, clean and rebuild.

OTHER TIPS

I just lost 2 hours because I didn't follow Insane4Sure's instructions properly. Change the Code Generation Strategy (Right click in the empty space in the Model diagram (.edmx file) and click properties. Code Generation Strategy is the first option - set it to 'Legacy ObjectContext'. Here's the important part - delete all the .tt files that are under the .edmx file in Solution Explorer. I though I'd deleted them all but didn't. When you clean and build you'll be able to click the Refresh Schema button.

Changing the Code Generation Strategy didn't work for me. But, adding the following to my web config file did:

<compilation debug="true" targetFramework="4.5">
  <assemblies>
    <add assembly="System.Security, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
    <add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
    <add assembly="System.Data.Entity.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
  </assemblies>
</compilation>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top