Request for the permission of type 'System.Data.SqlClient.SqlClientPermission failed
- by Richmond
Hi All!
I have asp.net application, using LINQ to connecto to SQL Server 2008 R2 databse.
My connection string:
Data Source=[SqlServerIp];Initial Catalog=[databaseName]User Id=newLogin;Password=newPassword;
When I deploy application on my local IIS (which is not the same machine as database server) it works fine, but when I deploy application on other IIS (the same machine as sqlServer) it throws an exception:
System.Security.SecurityException: Request for the permission of type 'System.Data.SqlClient.SqlClientPermission, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
Anyone knows how to fix it? Maybe it is due to some bad configuration of IIS?
Please help.