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

I have developed an application page for SharePoint 2007 and it works fine. When I tried to connect to SQL Server 2005 database I am getting following error:

Request for the permission of type 'System.Data.SqlClient.SqlClientPermission, System.Data, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed

Please help!


share|improve this question
How are you connecting to the 2005 database? A data connection? .Net code? could you provide an example? – Dave Wise May 2 '13 at 15:52

You will need to make sure that either the caller's domain account or the SP application pool account has the proper permissions on the SQL 2005 database. The account used when making the call depends entirely on your code.

share|improve this answer
This issue is not related to accessing a database but cannot use the assembly or not have enough permission to use that assembly. BTW I gave the app pool user access to that database and the problem is same. – AmitKB May 2 '13 at 15:32

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.