I have compiled a stand alone application that connects to our sql server and reads data from the tables, providing searches. I have also compiled the same code as a dll to be used as a command in AutoCAD. But the dll exits at the sql connection string.
The error message is:
Request for permission of type 'System.Data.SqlClient.SqlClientPermission, System.Data, Version=126.96.36.199, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
The connection string includes the following info:
Any ideas? Have I missed something? Why doesnt the dll connect but the exe does?
Public Sub AllUsers()
Public Function GetUsers() As DataSet
Dim MyConnection As System.Data.SqlClient.SqlConnection = New System.Data.SqlClient.SqlConnection("server=sql-data;uid=YOUR_NAME;pwd=YOUR_PASSWORD;Trusted_Connection=false;database=WorkWithIt")
Dim MyCommand As System.Data.SqlClient.SqlDataAdapter = New System.Data.SqlClient.SqlDataAdapter("SELECT Email FROM Users", MyConnection)
Dim DS As DataSet = New DataSet
Aha!! It is a security issue (still not solved though). I have just written my first VB.Net code to make a text file and I have encountered a similar error message ... System.Security.Permissions.FileIOPermission, mscorlib ... failed (mscorlib.dll). I'm about to do some searching to see why.
Request for the permission of type 'System.Data.SqlClient.SqlClientPermission, System.Data, Version=188.8.131.52, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
this error occur even setting the Permission to FullTrust which is availabel in the permission tab