关于System.Data.SqlClient.SqlClientPermission的一个异常
使用ASP.net 2.0,用C#定义了一个SQL存储过程(Submit_Answer),然后将dll在SQL Server中注册了。但是在程序中调用这个存储过程时,出现了下面所示的异常。从堆栈信息可以看出,是刚刚进入存储过程后打开数据库连接时出的错,也就是说该存储过程里面对数据库操作没有权限,对么?应该怎么解决这个问题呢?
请大家指教,谢谢!我是初学,可能有描述不太专业的地方,还请大家多多包涵。
***************************
异常信息及堆栈信息摘录如下:
***************************
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。
异常详细信息: System.Data.SqlClient.SqlException: A .NET Framework error occurred during execution of user defined routine or aggregate 'Submit_Answer':
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.
System.Security.SecurityException:
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.SqlClient.SqlConnection.PermissionDemand()
at System.Data.SqlClient.SqlConnectionFactory.PermissionDemand(DbConnection outerConnection)
at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
at System.Data.SqlClient.SqlConnection.Open()
at StoredProcedures.Submit(SqlChars strAnswer)