I am having problems accessing an external database from a CRM plugin. Received error:
"Request for the permission of type 'System.Data.SqlClient.SqlClientPermission, System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=xxx' failed."
The code works fine locally inside the "unit test". I tried to set the plugin isolation mode to "none". I tried looking at the article for help and tried everything he suggested, no luck.
Here is the current code I'm using:
var conn = new SqlConnection(@"Server=MyServer\Instance;DataBase=MyDB;User Id=MyUser;Password=MyPassword;Integrated Security=false;");
conn.Open();
I also tried this connection string and granted NT AUTHORITY \ NETWORK SERVICE user access to the database.
var conn = new SqlConnection(@"Data Source=MyDS\Instance;Initial Catalog=MyDB;Integrated Security=SSPI;");
conn.Open();
I am in Dynamics CRM 2015 On-Premise.
: , , , , . , ?