Day: April 26, 2005
Working with Windows SharePoint Lists
Working with Windows SharePoint Lists Text:
SharePoint Web Parts and SqlClientPermission Errors
Removing SharePoint Web Parts and SqlClientPermission Errors/exceptions
SharePoint Web Parts and SqlClientPermission Errors
Posted on Thursday, May 20, 2004 4:19 PM
If you are developing custom web parts that need to connect to a SQL Server database to retrieve data, you may be confronted with the following error:
{"Request for the permission of type System.Data.SqlClient.SqlClientPermission, System.Data, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 failed." }
This is due to SharePoint Portal Server and Windows SharePoint Services implementation of .NET Code Access Security (CAS). A solution that addresses the aforementioned error is cited below:
Locate and open the wss_minimaltrust.config file (NOTE: If you’ve gone with the default SharePoint or WSS install, this file is located at <INSTALL_DRIVE>:\Program Files\Common Files\Microsoft Shared\Server Extensions\60\Config)
Add the following element to the SecurityClasses section of this config file:
<SecurityClass Name="SqlClientPermission"
Description="System.Data.SqlClient.SqlClientPermission, System.Data,
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
/>
In the PermissionSet section of this configuration file, add the following:
<IPermission class="SqlClientPermission" version="1"
Unrestricted="true" />
If you still run into the error, try adding these settings to the wss_mediumtrust.config file.
Yasir Attiq Butt
Dubugging IEXPlorer for Web Applications
2. OPen the .asp Page in VS.Dot Net
Resource cost Fields
Regular work cost = Regular Work x Standard Rate
Overtime Rate
Overtime Cost = Overtime Work x Overtime rate
Yasir