Discuz!NT

注册

 

QQ登录

只需一步,快速开始

发新话题 回复该主题

[经验] 服务器日志中出现报错:必须声明标量变量 "@tid"的解... [复制链接]

1#
报错URL类似:aspx/3/showtopic.aspx?onlyauthor=2&topicid=1778&forumpage=1&posterid=3&page=2&selectedtemplateid=3

报错内容为:

必须声明标量变量 "@tid"。
                                     
异常详细信息:
System.Data.SqlClient.SqlException: 必须声明标量变量 "@tid"。            
堆栈跟踪:

[SqlException (0x80131904): 必须声明标量变量 "@tid"。]
   System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +1950890
   System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +4846875
   System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +194
   System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +2392
   System.Data.SqlClient.SqlDataReader.ConsumeMetaData() +33
   System.Data.SqlClient.SqlDataReader.get_MetaData() +83
   System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +297
   System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) +954
   System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) +162
   System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) +32
   System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) +141
   System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior) +12
   System.Data.Common.DbCommand.ExecuteReader(CommandBehavior behavior) +10
   Discuz.Data.DbHelper.ExecuteReader(DbConnection connection, DbTransaction transaction, CommandType commandType, String commandText, DbParameter[] commandParameters, DbConnectionOwnership connectionOwnership) +380
   Discuz.Data.DbHelper.ExecuteReader(CommandType commandType, String commandText, DbParameter[] commandParameters) +128
   Discuz.Data.SqlServer.DataProvider.GetPostListByCondition(PostpramsInfo postPramsInfo, String postTableId) +403
   Discuz.Data.Posts.GetPostList(PostpramsInfo postpramsInfo) +74
   Discuz.Forum.Posts.GetPostList(PostpramsInfo postpramsInfo, List`1& attachList, Boolean isModer) +309
   Discuz.Web.showtopic.GetPostPramsInfo(Int32 price) +507
   Discuz.Web.showtopic.ShowPage() +907
   Discuz.Forum.PageBase..ctor() +3406
   Discuz.Web.UI.TopicPage..ctor() +371
   Discuz.Web.showtopic..ctor() +157
   ASP.aspx_3_showtopic_aspx..ctor() in c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\bbs\d6b2a6ad\389eb75a\App_Web_glhelpel.14.cs:0
   __ASP.FastObjectFactory_app_web_glhelpel.Create_ASP_aspx_3_showtopic_aspx() in c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\bbs\d6b2a6ad\389eb75a\App_Web_glhelpel.15.cs:0
   System.Web.Compilation.BuildResultCompiledType.CreateInstance() +32
   System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp, Boolean noAssert) +119
   System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) +33
   System.Web.UI.PageHandlerFactory.System.Web.IHttpHandlerFactory2.GetHandler(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) +40
   System.Web.HttpApplication.MapHttpHandler(HttpContext context, String requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig) +160
   System.Web.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +93
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155
            



解决方法:
后台=>论坛=>论坛数据维护:更新分表存储过程
分享 转发
离开一段时间~有问题直接群或者QQ联系。
TOP
发新话题 回复该主题
站长