Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Entity Model Issue: Not able to create model for one particular table

While creating the entity model I am getting the following error .

Added the connection string to Web.Config.
Successfully registered the assembly 'System.Data.Entity, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' in Web.Config.
ERROR: Unable to generate model because of the following exception: 'Value does not fall within the expected range.'.
Loading metadata from database took 00:00:02.1203632.
Generating model took 00:00:00.8390920.
Writing out the EDMX file took 00:00:00.

All the tables are getting created but the BC_States table is not getting created.I can't understand why.

like image 875
Ritz Avatar asked Feb 04 '10 12:02

Ritz


2 Answers

I've just been investigating a similar issue. It turns out that Entity Framework outputs additional error information in the Messages section of the Error List window in Visual Studio.

As you can see it's much more useful than the generic error that appears in the Output window. This was crucial in helping me to solve my problem.

enter image description here

like image 162
Doctor Jones Avatar answered Oct 17 '22 21:10

Doctor Jones


The question is not readable but I found the similar question at Ado.Net Entity Data Model Not Updating Correctly.

As for me (I had the same problem) the issue was because of there was no primary key set on one of the tables.

like image 43
Regent Avatar answered Oct 17 '22 21:10

Regent