I'm not sure what I am missing. I still get #error - where is the error more
detailed than this? How would you ever know what the error is since
documentation is so bad? I am trying to access SQL Server database.
Here is my code:
<System.Data.SqlClient.SqlClientPermission(Security.Permissions.SecurityAction.Assert, Unrestricted:=True)> _
Public Shared Function GetMdx(ByVal sUserName As String) As String
GetSqlConnection = New SqlClient.SqlConnection
GetSqlConnection.ConnectionString = "Data Source=datasourcehere;User
Id=userhere;Password=passwordhere"
GetSqlConnection.Open()
' do query here
End Function
Here are entries in rssrvpolicy.config:
<PermissionSet
class="NamedPermissionSet"
version="1"
Name="SqlClientPermissionSet"
Description="A special permission set that grants access to do SQL Server DB
Access.">
<IPermission
class="SqlClientPermission"
version="1"
Unrestricted="true"
/>
<IPermission
class="SecurityPermission"
version="1"
Flags="Execution, Assertion"
/>
</PermissionSet>
<CodeGroup
class="UnionCodeGroup"
version="1"
PermissionSetName="SqlClientPermissionSet"
Name="MyCustomAssemblyCodeGroup"
Description="For my custom assembly">
<IMembershipCondition
class="UrlMembershipCondition"
version="1"
Url="C:\Program Files\Microsoft SQL Server\MSSQL\Reporting
Services\ReportServer\bin\MyDll.dll"
/>
</CodeGroup>
Still get #error - not sure where to get any further detail.I am having the same problem trying to use a custom assembly. Any ideas
would be greatly appreciated.
"danb" <danb@.discussions.microsoft.com> wrote in message
news:F745A822-599F-4FB4-9E32-614DECB5006E@.microsoft.com...
> I'm not sure what I am missing. I still get #error - where is the error
more
> detailed than this? How would you ever know what the error is since
> documentation is so bad? I am trying to access SQL Server database.
> Here is my code:
>
<System.Data.SqlClient.SqlClientPermission(Security.Permissions.SecurityActi
on.Assert, Unrestricted:=True)> _
> Public Shared Function GetMdx(ByVal sUserName As String) As String
> GetSqlConnection = New SqlClient.SqlConnection
> GetSqlConnection.ConnectionString = "Data Source=datasourcehere;User
> Id=userhere;Password=passwordhere"
> GetSqlConnection.Open()
> ' do query here
> End Function
> Here are entries in rssrvpolicy.config:
> <PermissionSet
> class="NamedPermissionSet"
> version="1"
> Name="SqlClientPermissionSet"
> Description="A special permission set that grants access to do SQL Server
DB
> Access.">
> <IPermission
> class="SqlClientPermission"
> version="1"
> Unrestricted="true"
> />
> <IPermission
> class="SecurityPermission"
> version="1"
> Flags="Execution, Assertion"
> />
> </PermissionSet>
>
> <CodeGroup
> class="UnionCodeGroup"
> version="1"
> PermissionSetName="SqlClientPermissionSet"
> Name="MyCustomAssemblyCodeGroup"
> Description="For my custom assembly">
> <IMembershipCondition
> class="UrlMembershipCondition"
> version="1"
> Url="C:\Program Files\Microsoft SQL Server\MSSQL\Reporting
> Services\ReportServer\bin\MyDll.dll"
> />
> </CodeGroup>
>
> Still get #error - not sure where to get any further detail.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment