Sharepoint Error Running Notes

June 4, 2009

SharePoint Error:

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

Solution: (Source: http://social.msdn.microsoft.com/forums/en-US/sqlreportingservices/thread/ee54dd71-5d65-43b7-a4eb-5e893d82cc0a)

That might be related with the trust level located in the web.config file.

Go to the web.config file and locate the wss_mediumtrust.config file location, usualy you can find it under c:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\config\

In the wss_mediumtrust.config file locate the <SecurityClass Name=”SqlClientPermission”
Description=”System.Data.SqlClient.SqlClientPermis sion, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089″/>, copy and paste it in to the <SecurityClasses> node of
wss_minimaltrust.config.

In the PermissionSet section of this configuration file, add the following:
Find in wss_mediumtrust.config: <IPermission version=”1″ Unrestricted=”true”/>, copy and paste it in to the a <PermissionSet> node of wss_minimaltrust.config.

It has risen one more error: LINQ

Error: field access exception was unhandled by user code

Solution:

In web.config file under system.web tag add this   <

trust level=Full originUrl=“” />