entity framework 4 - Unable to cast object of type to type 'System.Data.Objects.ObjectContext -
i have been following tutorial -> http://www.asp.net/web-forms/tutorials/getting-started-with-ef/the-entity-framework-and-aspnet-getting-started-part-2
i'm stuck in topic - revising entitydatasource control markup improve performance. when set contexttypename
property removing connectionstring
, defaultcontainername
, i'm getting error message;
unable cast object of type 'contosouniversity.dal.schoolentities' type 'system.data.objects.objectcontext'.
please note: using connectionstring
, defaultcontainername
works fine.
try link msdn article below solved problem when going through same tutorial.
just change schoolcontext schoolentities in method schoolcontextentitydatasource_contextcreating()
best regards,
adit malik
Comments
Post a Comment