InfoPath2007中通过MOSS的webservice读取数据库时需注意的事项

我在infopath中进行查询时出现如下问题:
服务器无法处理请求。 ---> SELECT     ×  FROM [表名]请求“System.Data.SqlClient.SqlClientPermission, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089”类型的权限已失败。

解决方法:
参考了http://www.cnblogs.com/foxhorse/archive/2007/09/20/899576.html
具体修改如下:
1.打开C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\CONFIG\wss_minimaltrust.config

2. 在    </SecurityClasses>上添加如下内容

            <SecurityClass Name="SqlClientPermission" Description="System.Data.SqlClient.SqlClientPermission, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />

3.找到如下内容,并添加红字部分内容。 
<PermissionSet
                                class="NamedPermissionSet"
                                version="1"
                                Name="SPRestricted">
                            <IPermission
                                    class="AspNetHostingPermission"
                                    version="1"
                                    Level="Minimal"
                            />
                              ...................                           
                       <IPermission class="SqlClientPermission"   version="1"    Unrestricted="true" />
                        </PermissionSet>

                   

posted on 2007-12-30 13:39  JEEF WANG  阅读(700)  评论(0编辑  收藏  举报

导航