不允许从数据类型 datetime 到数据类型 int 的隐性转换(表 'tempdb.dbo.#3884BFB0',列 'IsNominate')。请使用 CONVERT

 

 

不允许从数据类型 datetime 到数据类型 int 的隐性转换(表 'tempdb.dbo.#3884BFB0',列 'IsNominate')。请使用 CONVERT

函数来运行此查询。

 

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: 不允许从数据类型 datetime 到数据类型 int 的隐性转换(表 'BBS2031.dbo.pz_Forum_ReplyRecycle',列 'TableNumber')。请使用 CONVERT 函数来运行此查询。

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.

Stack Trace:

[SqlException (0x80131904): 不允许从数据类型 datetime 到数据类型 int 的隐性转换(表 'BBS2031.dbo.pz_Forum_ReplyRecycle',列 'TableNumber')。请使用 CONVERT 函数来运行此查询。]
   System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +857434
   System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +735046
   System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +188
   System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +1838
   System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async) +192
   System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) +380
   System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +135
   DXBBS.DataProviders.DataProvider.ExecuteNonQuery(String CommandTxt) +59
   DXBBS.DataProviders.ForumProvider.DeletePost(PostDeleteInfo pd, DataProvider dp) +3146
   DXBBS.Business.Forum.DeletePost(PostDeleteInfo pd, DataProvider dp) +5
   DXBBS.Controls.PostEdit.DeleteButton_Click(Object sender, EventArgs e) +906
   System.Web.UI.WebControls.Button.OnClick(EventArgs e) +105
   System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +107
   System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102


 

问题的根本原因在与字段顺序对错了  ,问题主要放生在存储过程。尤其是在存储过程中创建一临时表的时候,也就是在临时表的字段排列顺序上有问题

 

 

存储过程提示错误

 

服务器: 消息 260,级别 16,状态 1,行 7
不允许从数据类型 datetime 到数据类型 int 的隐性转换(表 'tempdb.dbo.#3884BFB0',列 'IsNominate')。请使用 CONVERT

函数来运行此查询。

 

这就是问题的根本。。。

 

 

本次问题的原因在与  在添冲临时表的是时候用到了select *  from XXX 表里面的字段与存储过程中临时表的字段顺序不匹配。。


 

 

 

 

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

一直学习

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值