asp.net mvc 3 - entity framework error after attached .mdf file -


i attached .mdf file in sql server 2008 , used database entity framework database first project. below error got

exception details: system.data.mappingexception: schema specified not valid.
error 2062: no mapping specified instances of entityset , associationset in entitycontainer"

i tried link: how correctly set association between 2 objects in entity framework 4 entitydesigner?

but did not work me. can me can problem.

thanks, michaeld

this exception occures if have entity in model doesn't mapped table (or object) database.

if want project starts debugging, remove entities model, right-click in model designer , choose update model database

if have entity supposed mapped table database, should create relative table in database, , map entity table. can ghange approach db-first code-first , enable migrations ef updates db according model.

if have entity , want map stored procedure in db, see here


Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -