简体   繁体   English

SQL Server CLR函数类型不匹配

[英]SQL Server CLR Function Type Mismatch

I'm passing a T-SQL type of char(1) into a C# CLR function. 我正在将char(1)的T-SQL类型传递到C#CLR函数中。

At the C# side I have the type char. 在C#端,我有char类型。

I'm getting the error "CLR types for parameter ... do not match." 我收到错误消息“参数的CLR类型...不匹配。”

Any ideas? 有任何想法吗?

AFAIK, char SQL Server data type doesn't have equivalent in the CLR for SQL Server in the System.Data.SqlTypes namespace, and their native CLR equivalents in the Microsoft .NET Framework. AFAIK, char SQL Server数据类型在System.Data.SqlTypes命名空间的SQL Server的CLR中没有等效项,而在Microsoft .NET Framework中没有等效的本地CLR

But eg nchar(1) does - SqlChars or SqlString for the CLR data type(SQL Server) and Char , String or Char[] for CLR data type (.NET Framework). 但是例如nchar(1)可以-对于CLR数据类型(SQL Server)使用SqlCharsSqlString ,对于CLR数据类型(.NET Framework)使用CharStringChar[]

See the MSDN Mapping CLR Parameter Data article for more details. 有关更多详细信息,请参见MSDN Mapping CLR参数数据一文。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM