我正在尝试为使用.net 3.5程序集的sql 2005数据库创建一个clr存储过程
所以首先我必须改变sql 2005来识别system.core是不安全的我不太高兴(我宁愿让它说SAFE).
现在我收到了这个错误
Msg 6522, Level 16, State 1, Procedure StoredProcedure1, Line 0
A .NET Framework error occurred during execution of user defined routine or aggregate 'StoredProcedure1':
System.Security.HostProtectionException: Attempted to perform an operation that was forbidden by the CLR host.
The protected resources (only available with full trust) were: All
The demanded resources were: MayLeakOnAbort
System.Security.HostProtectionException:
at StoredProcedures.StoredProcedure1(String UtcDateTime)
Run Code Online (Sandbox Code Playgroud)
这是我的代码
Exec StoredProcedure1 '7/8/2010 5:00:00 am'
using System;
using System.Data;
using System.Data.SqlClient;
using System.Data.SqlTypes;
using Microsoft.SqlServer.Server;
public partial …Run Code Online (Sandbox Code Playgroud)