Skip to main content

Posts

Showing posts from April, 2014

WCF: The underlying connection was closed

hi, just got an error for couple of days when try to return a model contain child record using Entity Framework and DBContext i have this Role class that contain list of User within that Role so when i try to get specific Role along with the User it give me an error "The underlying connection was closed " after searching alot i came up with this great solution disabled proxy creation and lazy loading or  manually in Entity DBContext constructor it run succesfully and can return UserInRole but if i filled up the table then the error comes, so we need to  Preserving Object Reference in WCF  but i came with this very useful  Andrey Chabster Blog  that using custom attribute that needed for the Service contract and Operation contract  until then

The version of SQL Server in use does not support datatype datetime2

hi again,  just came up with this error in Entity Framework  the reason is because my development using SQL2008 express edition but the preproduction using SQL2005 and the solution is fairly simple  Open your EDMX in a file editor (or “open with…” in Visual Studio and select XML Editor). At the top you will find the storage model and it has an attribute ProviderManifestToken. This has should have the value 2008. Change that to 2005, recompile and everything works after trying up for 2 hours :D until then