System.Security.SecurityException

D

Deepika

Hai,

I have this error:
System.Security.SecurityException: Request for the permission of type
System.Data.SqlClient.SqlClientPermission, System.Data, Version=1.0.5000.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089 failed.

I have my program written as a console application in C# .NET.

Can anyone help me with this???
 
A

Andreas Håkansson

Deepika,

Please provide use with the code you are using (and only the code which
is
causing the error) if you are using a hardcoded connection-string then
please
remember to mask the account password if you use any.

//Andreas
 
J

Jeffrey Tan[MSFT]

Hi Deepika,

Does the community's reply make sense to you?

Please feel free to feedback. Thanks

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
J

Jeffrey Tan[MSFT]

Hi Deepika,

Based on the error message, your application assembly does not have the
SqlClientPermission. You should check your assembly's permission set, it
should have unrestricted permission. If it does not have
SqlClientPermission, you then determine the assembly's code group, adding
SqlClientPermission to that code group.

To view the code group and permission set of the assembly, you may:
1). Open Control Panel-> Administration Tools
2). Open .Net Configuration 1.1
3). Select "Runtime Security Policy"
4). Click "Evaluate Assembly"

Then, you can browse and select your assembly and view it permission set and
code group.

Hope this can help you.

Thanks

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top