解决错误:sql_variantisincompatiblewithxml(ASP.NET2.0/XML数据类型)
2008-04-24 06:41
387 查看
发生场景:
1:如果数据表使用XML数据类型
2:使用ASP.NET 2.0
3::使用向导生成sqlDataSource配合DetailsView新增/更新数据库XML数据类型
错误信息:
Server Error in '/' Application.
--------------------------------------------------------------------------------
Operand type clash: sql_variant is incompatible with XML
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.sqlClient.sqlException: Operand type clash: sql_variant is incompatible with XML
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
解决办法:
<DeleteParameters>
<ASP:Parameter Name="original_ArticleID" Type="Int32" />
<ASP:Parameter Name="original_Title" Type="String" />
<ASP:Parameter Name="original_CategoryID" Type="Int32" />
<ASP:Parameter Name="original_Contents" Type="String" />
<ASP:Parameter Name="original_ArticleFrom" Type="String" />
<ASP:Parameter Name="original_CreateDate" Type="DateTime" />
<ASP:Parameter Name="original_keywordXML" Type="Object" />
</DeleteParameters>
<UpdateParameters>
<ASP:Parameter Name="Title" Type="String" />
<ASP:Parameter Name="CategoryID" Type="Int32" />
<ASP:Parameter Name="Contents" Type="String" />
<ASP:Parameter Name="ArticleFrom" Type="String" />
<ASP:Parameter Name="CreateDate" Type="DateTime" />
<ASP:Parameter Name="keywordXML" Type="Object" />
<ASP:Parameter Name="original_ArticleID" Type="Int32" />
<ASP:Parameter Name="original_Title" Type="String" />
<ASP:Parameter Name="original_CategoryID" Type="Int32" />
<ASP:Parameter Name="original_Contents" Type="String" />
<ASP:Parameter Name="original_ArticleFrom" Type="String" />
<ASP:Parameter Name="original_CreateDate" Type="DateTime" />
<ASP:Parameter Name="original_keywordXML" Type="Object" />
</UpdateParameters>
<InsertParameters>
<ASP:Parameter Name="Title" Type="String" />
<ASP:Parameter Name="CategoryID" Type="Int32" />
<ASP:Parameter Name="Contents" Type="String" />
<ASP:Parameter Name="ArticleFrom" Type="String" />
<ASP:Parameter Name="CreateDate" Type="DateTime" />
<ASP:Parameter Name="keywordXML" Type="Object" />
</InsertParameters>
将下划线部分Type="Object" -〉Type="String"
http://cleo.cnblogs.com/archive/2006/05/22/406577.html
1:如果数据表使用XML数据类型
2:使用ASP.NET 2.0
3::使用向导生成sqlDataSource配合DetailsView新增/更新数据库XML数据类型
错误信息:
Server Error in '/' Application.
--------------------------------------------------------------------------------
Operand type clash: sql_variant is incompatible with XML
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.sqlClient.sqlException: Operand type clash: sql_variant is incompatible with XML
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
解决办法:
<DeleteParameters>
<ASP:Parameter Name="original_ArticleID" Type="Int32" />
<ASP:Parameter Name="original_Title" Type="String" />
<ASP:Parameter Name="original_CategoryID" Type="Int32" />
<ASP:Parameter Name="original_Contents" Type="String" />
<ASP:Parameter Name="original_ArticleFrom" Type="String" />
<ASP:Parameter Name="original_CreateDate" Type="DateTime" />
<ASP:Parameter Name="original_keywordXML" Type="Object" />
</DeleteParameters>
<UpdateParameters>
<ASP:Parameter Name="Title" Type="String" />
<ASP:Parameter Name="CategoryID" Type="Int32" />
<ASP:Parameter Name="Contents" Type="String" />
<ASP:Parameter Name="ArticleFrom" Type="String" />
<ASP:Parameter Name="CreateDate" Type="DateTime" />
<ASP:Parameter Name="keywordXML" Type="Object" />
<ASP:Parameter Name="original_ArticleID" Type="Int32" />
<ASP:Parameter Name="original_Title" Type="String" />
<ASP:Parameter Name="original_CategoryID" Type="Int32" />
<ASP:Parameter Name="original_Contents" Type="String" />
<ASP:Parameter Name="original_ArticleFrom" Type="String" />
<ASP:Parameter Name="original_CreateDate" Type="DateTime" />
<ASP:Parameter Name="original_keywordXML" Type="Object" />
</UpdateParameters>
<InsertParameters>
<ASP:Parameter Name="Title" Type="String" />
<ASP:Parameter Name="CategoryID" Type="Int32" />
<ASP:Parameter Name="Contents" Type="String" />
<ASP:Parameter Name="ArticleFrom" Type="String" />
<ASP:Parameter Name="CreateDate" Type="DateTime" />
<ASP:Parameter Name="keywordXML" Type="Object" />
</InsertParameters>
将下划线部分Type="Object" -〉Type="String"
http://cleo.cnblogs.com/archive/2006/05/22/406577.html
相关文章推荐
- 解决错误:sql_variant is incompatible with xml (ASP.NET 2.0 / XML数据类型 )
- [置顶] 【mysql 使用错误解决】this is incompatible with sql_mode=only_full_group_by
- 【Maven】Project configuration is not up-to-date with pom.xml错误解决方法
- 解决SQL将varchar值转换为数据类型为int的列时发生语法错误
- 【Maven】Project configuration is not up-to-date with pom.xml错误解决方法
- 错误argument of type "char *" is incompatible with parameter of type "LPCWSTR"的解决方法
- 解决:mysql 5.7.9 [Err] 1055 ...this is incompatible with sql_mode=only_full_group_by
- Project configuration is not up-to-date with pom.xml错误解决方法
- Project configuration is not up-to-date with pom.xml错误解决方法 (
- 【Maven】Project configuration is not up-to-date with pom.xml错误解决方法
- 【Maven】Project configuration is not up-to-date with pom.xml错误解决方法
- Maven Project configuration is not up-to-date with pom.xml错误解决方法
- 【C#】解决进行反序列化时出错:。InnerException 消息是“反序列化对象 属于类型 System.String 时出现错误。读取 XML 数据时,超出最大字符串内容长度配额 (8192)。
- 【Maven】Project configuration is not up-to-date with pom.xml错误解决方法
- 解决MySQL 5.7.9版本sql_mode=only_full_group_by问题,this is incompatible with sql_mode=only_full_group_by错误
- Linux 3.9.10内核编译错误:multiple (or no) load addresses: This is incompatible with uImages的解决
- Project configuration is not up-to-date with pom.xml错误解决方法
- sql 将 varchar 值转换为数据类型为 int 的列时发生语法错误 的解决办法
- 错误argument of type "char *" is incompatible with parameter of type "LPCWSTR"的解决方法
- MySQL分组查询时出现错误SELECT list is not in GROUP BY ;this is incompatible with sql_mode=only_full_group_by