发生场景:
1:如果数据表使用XML数据类型
2:使用ASP.net 2.0
3::使用向导生成SqlDataSource配合DetailsView新增/更新数据库XML数据类型

错误信息:
解决错误:sql_variant is incompatible with xml (ASP.NET 2.0 / XML数据类型 )Server Error in '/' Application.
解决错误:sql_variant is incompatible with xml (ASP.NET 2.0 / XML数据类型 )
--------------------------------------------------------------------------------
解决错误:sql_variant is incompatible with xml (ASP.NET 2.0 / XML数据类型 )
解决错误:sql_variant is incompatible with xml (ASP.NET 2.0 / XML数据类型 )Operand type clash: sql_variant 
is incompatible with xml 
解决错误:sql_variant is incompatible with xml (ASP.NET 2.0 / 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. 
解决错误:sql_variant is incompatible with xml (ASP.NET 2.0 / XML数据类型 )
解决错误:sql_variant is incompatible with xml (ASP.NET 2.0 / XML数据类型 )Exception Details: System.Data.SqlClient.SqlException: Operand type clash: sql_variant 
is incompatible with xml
解决错误:sql_variant is incompatible with xml (ASP.NET 2.0 / XML数据类型 )
解决错误:sql_variant is incompatible with xml (ASP.NET 2.0 / XML数据类型 )Source Error: 
解决错误:sql_variant is incompatible with xml (ASP.NET 2.0 / XML数据类型 )
解决错误:sql_variant is incompatible with xml (ASP.NET 2.0 / XML数据类型 )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.  
解决错误:sql_variant is incompatible with xml (ASP.NET 2.0 / XML数据类型 )
 
解决办法:
解决错误:sql_variant is incompatible with xml (ASP.NET 2.0 / XML数据类型 )<DeleteParameters>
解决错误:sql_variant is incompatible with xml (ASP.NET 2.0 / XML数据类型 )                
<asp:Parameter Name="original_ArticleID" Type="Int32" />
解决错误:sql_variant is incompatible with xml (ASP.NET 2.0 / XML数据类型 )                
<asp:Parameter Name="original_Title" Type="String" />
解决错误:sql_variant is incompatible with xml (ASP.NET 2.0 / XML数据类型 )                
<asp:Parameter Name="original_CategoryID" Type="Int32" />
解决错误:sql_variant is incompatible with xml (ASP.NET 2.0 / XML数据类型 )                
<asp:Parameter Name="original_Contents" Type="String" />
解决错误:sql_variant is incompatible with xml (ASP.NET 2.0 / XML数据类型 )                
<asp:Parameter Name="original_ArticleFrom" Type="String" />
解决错误:sql_variant is incompatible with xml (ASP.NET 2.0 / XML数据类型 )                
<asp:Parameter Name="original_CreateDate" Type="DateTime" />
解决错误:sql_variant is incompatible with xml (ASP.NET 2.0 / XML数据类型 )                
<asp:Parameter Name="original_keywordXML" Type="Object" />
解决错误:sql_variant is incompatible with xml (ASP.NET 2.0 / XML数据类型 )            
</DeleteParameters>
解决错误:sql_variant is incompatible with xml (ASP.NET 2.0 / XML数据类型 )            
<UpdateParameters>
解决错误:sql_variant is incompatible with xml (ASP.NET 2.0 / XML数据类型 )                
<asp:Parameter Name="Title" Type="String" />
解决错误:sql_variant is incompatible with xml (ASP.NET 2.0 / XML数据类型 )                
<asp:Parameter Name="CategoryID" Type="Int32" />
解决错误:sql_variant is incompatible with xml (ASP.NET 2.0 / XML数据类型 )                
<asp:Parameter Name="Contents" Type="String" />
解决错误:sql_variant is incompatible with xml (ASP.NET 2.0 / XML数据类型 )                
<asp:Parameter Name="ArticleFrom" Type="String" />
解决错误:sql_variant is incompatible with xml (ASP.NET 2.0 / XML数据类型 )                
<asp:Parameter Name="CreateDate" Type="DateTime" />
解决错误:sql_variant is incompatible with xml (ASP.NET 2.0 / XML数据类型 )                
<asp:Parameter Name="keywordXML" Type="Object" />
解决错误:sql_variant is incompatible with xml (ASP.NET 2.0 / XML数据类型 )                
<asp:Parameter Name="original_ArticleID" Type="Int32" />
解决错误:sql_variant is incompatible with xml (ASP.NET 2.0 / XML数据类型 )                
<asp:Parameter Name="original_Title" Type="String" />
解决错误:sql_variant is incompatible with xml (ASP.NET 2.0 / XML数据类型 )                
<asp:Parameter Name="original_CategoryID" Type="Int32" />
解决错误:sql_variant is incompatible with xml (ASP.NET 2.0 / XML数据类型 )                
<asp:Parameter Name="original_Contents" Type="String" />
解决错误:sql_variant is incompatible with xml (ASP.NET 2.0 / XML数据类型 )                
<asp:Parameter Name="original_ArticleFrom" Type="String" />
解决错误:sql_variant is incompatible with xml (ASP.NET 2.0 / XML数据类型 )                
<asp:Parameter Name="original_CreateDate" Type="DateTime" />
解决错误:sql_variant is incompatible with xml (ASP.NET 2.0 / XML数据类型 )                
<asp:Parameter Name="original_keywordXML" Type="Object" />
解决错误:sql_variant is incompatible with xml (ASP.NET 2.0 / XML数据类型 )            
</UpdateParameters>
解决错误:sql_variant is incompatible with xml (ASP.NET 2.0 / XML数据类型 )            
<InsertParameters>
解决错误:sql_variant is incompatible with xml (ASP.NET 2.0 / XML数据类型 )                
<asp:Parameter Name="Title" Type="String" />
解决错误:sql_variant is incompatible with xml (ASP.NET 2.0 / XML数据类型 )                
<asp:Parameter Name="CategoryID" Type="Int32" />
解决错误:sql_variant is incompatible with xml (ASP.NET 2.0 / XML数据类型 )                
<asp:Parameter Name="Contents" Type="String" />
解决错误:sql_variant is incompatible with xml (ASP.NET 2.0 / XML数据类型 )                
<asp:Parameter Name="ArticleFrom" Type="String" />
解决错误:sql_variant is incompatible with xml (ASP.NET 2.0 / XML数据类型 )                
<asp:Parameter Name="CreateDate" Type="DateTime" />
解决错误:sql_variant is incompatible with xml (ASP.NET 2.0 / XML数据类型 )                
<asp:Parameter Name="keywordXML" Type="Object" />
解决错误:sql_variant is incompatible with xml (ASP.NET 2.0 / XML数据类型 )            
</InsertParameters>

将下划线部分Type="Object"  -〉Type="String" 

相关文章:

  • 2021-05-03
  • 2022-01-28
  • 2021-09-27
  • 2022-12-23
  • 2021-11-08
  • 2022-01-13
  • 2021-05-06
  • 2021-07-21
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-02-13
  • 2021-06-12
  • 2021-04-03
  • 2021-12-26
  • 2023-02-17
相关资源
相似解决方案