13

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.

Doctor Jones
  • 21,196
  • 13
  • 77
  • 99
Ritz
  • 141
  • 1
  • 3

2 Answers2

19

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

Doctor Jones
  • 21,196
  • 13
  • 77
  • 99
7

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.

Community
  • 1
  • 1
Regent
  • 5,502
  • 3
  • 33
  • 59
  • That was my issue as well. Just altered the table and I can import the table just fine. – Ammar May 16 '12 at 17:55