开发者

SqlClientPermission in a sandbox web part

开发者 https://www.devze.com 2023-04-12 20:36 出处:网络
I\'m trying a long time to get a working SQL connection in my web part. I read a lot of msdn stuff and tried many things, but I can\'t get it working... Every time I try to open a SQL connection, my w

I'm trying a long time to get a working SQL connection in my web part. I read a lot of msdn stuff and tried many things, but I can't get it working... Every time I try to open a SQL connection, my web part throw an exception: Request for the permission of type 'System.Data.Sql开发者_如何学编程Client.SqlClientPermission.

I tried custom.configs which set the .net trust higher, edit the manifest, set the permissions with the PermissionSet-Class and also tried FullTrust, but nothing worked. How do I set the permission correctly? Btw, the web part is a sandbox solution.

It would be awesome if someone could give me a detailed view, how to set the permissions.


For this kind of operation, You need to develop a full trust proxy(SPProxyOperation) to be used by your Sandbox Solutions.

The sandbox solutions has Code Access Security and Permission restrictions. For details you can visit: http://extreme-sharepoint.com/2011/10/07/sharepoint-sandbox-reallly-new-feature/

0

精彩评论

暂无评论...
验证码 换一张
取 消