發生場景:
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"
新聞熱點
疑難解答
圖片精選