解决错误:sql_variant is incompatible with xml (ASP.NET 2.0 / XML数据类型 )
2006-05-23 17:08:12 来源:WEB开发网发生场景:
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 Server 2008 R2 下如何清理数据库日志文件
- ››解决flash 中无法导出swf文件的方法
- ››解决"ios模拟器未能安装此应用程序"办法...
- ››解决jquery easyui easyloader加载外部js文件失败...
- ››解决无法使用Android SDK Manager下载SDK开发包的...
- ››sqlite 存取中文的解决方法
- ››SQL2005、2008、2000 清空删除日志
- ››解决网页内容无法复制
- ››解决Android手机在开发调试时logcat不显示输出信息...
- ››解决Windows 8操作系统假死的方法
- ››解决ubuntu 不识别 android 设备 方法
- ››解决ubuntu server sudo出现sudo:must be setuid ...
更多精彩
赞助商链接