Search code examples
c#sqlsql-server-2008remote-connection

Getting a permission error when trying to connect to sql database


I have a sql server on a dedicated machine, running SQL 2008. I have the IP of the box, a database setup on it.

I've built a small script that just does a connection test, and when I run it, I get the following error.

Request for the permission of type 'System.Data.SqlClient.SqlClientPermission, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

I've been told by the admin that SQL remote access has been granted for my IP address.

Anybody know what's wrong?


Solution

  • It turned out to be a .NET security issue.. Solved now..