SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

We have created some user controls which interact with the database using the entity framework. My question is how to use these controls in SharePoint. Do we have to copy the .edmx file to the /virtualdirectories/site folder?

Any ideas?


share|improve this question

The .edmx file is only used within the source. It's compiled with the Entity Model Code Generator Tool which creates the necessary classes. If you build a class library using the Entity Framework all you need to do is reference the output assembly in your SharePoint project. Or you can add an entity data model to your SharePoint project and use it as normal.

share|improve this answer
I m Getting this error after adding .edmx file and add the connection string in web.config Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed. – sbtahir Apr 16 '10 at 6:32
Its working fine now, just add <trust level="Full" /> inside <system.web> – sbtahir Apr 16 '10 at 6:44
or add a custom CAS policy to your WSP – Jaap Vossers Apr 16 '10 at 10:47
Or sign the assembly and install to the GAC – Paul Lucas Apr 16 '10 at 17:27

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.