System.Security.SecurityException: Request for the permission of type 'System.Data.Odbc.OdbcPermissi

Posted by User88 under ASP.NET on 9/15/2011 | Points: 10 | Views : 3482 | Status : [Member] | Replies : 0
ii wrote a vb code that creates a CLR stored procedure. this SP uses ODBC Vultar driver to connect to jBase, pulls the data, puts it in a data adaptor, then it saves the data in SQL server tables. When i run the vb code, the SP is created, but when I execute it in SQL server, i get the following error:

Msg 6522, Level 16, State 1, Procedure SP_Accounts, Line 0
A .NET Framework error occurred during execution of user-defined routine or aggregate "SP_Accounts":
System.Security.SecurityException: Request for the permission of type 'System.Data.Odbc.OdbcPermission, System.Data, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
at System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet)
at System.Security.PermissionSet.Demand()
at System.Data.Common.DbConnectionOptions.DemandPermission()
at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
at System.Data.Odbc.OdbcConnection.Open()
at SqlServerProject1.StoredProcedures.SP_Accounts(String& TableName)

I read many articles but didn;t find any solution for my problem.
Any help is appreciated.


(No response found.)

Login to post response