LinqToSQL执行方法的错误5242

时间:2009-11-25 19:03:49

标签: asp.net asp.net-mvc linq-to-sql

我在特定存储过程的代码执行过程中遇到以下错误,我很难过。其他一些存储过程可以正常工作,但这不是出于某种原因。

Warning: Fatal error 5242 occurred at Nov 25 2009 12:44PM. Note the error and time, and contact your system administrator


Line 66:        public ISingleResult<report_EventSummaryResult> EventSummary([Parameter(DbType="VarChar(7)")] string event_id, [Parameter(DbType="VarChar(12)")] string id)
Line 67:        {
Line 68:            IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), event_id, id);
Line 69:            return ((ISingleResult<report_EventSummaryResult>)(result.ReturnValue));
Line 70:        }

堆栈跟踪

[SqlException (0x80131904): Warning: Fatal error 5242 occurred at Nov 25 2009 12:44PM. Note the error and time, and contact your system administrator.]
   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.CloseInternal(Boolean closeReader) +169
   System.Data.SqlClient.SqlDataReader.Close() +96
   System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +292
   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() +12
   System.Data.Linq.SqlClient.SqlProvider.Execute(Expression query, QueryInfo queryInfo, IObjectReaderFactory factory, Object[] parentArgs, Object[] userArgs, ICompiledSubQuery[] subQueries, Object lastResult) +975
   System.Data.Linq.SqlClient.SqlProvider.ExecuteAll(Expression query, QueryInfo[] queryInfos, IObjectReaderFactory factory, Object[] userArguments, ICompiledSubQuery[] subQueries) +113
   System.Data.Linq.SqlClient.SqlProvider.System.Data.Linq.Provider.IProvider.Execute(Expression query) +344
   System.Data.Linq.DataContext.ExecuteMethodCall(Object instance, MethodInfo methodInfo, Object[] parameters) +69
   MVCApp.Models.EventReport.EventReportDataContext.EventSummary(String event_id, String id) in C:\Documents and Settings\lalex\Desktop\MVCApp\MVCApp\Models\EventReport\EventReport.designer.cs:68
   MVCApp.Models.EventReport.EventReportRepository.GetEventSummaryResult(String event_id, String Event) in C:\Documents and Settings\lalex\Desktop\MVCApp\MVCApp\Models\EventReport\EventReportRepository.cs:20
   MVCApp.Controllers.EventReports.EventReportsController.Generate(FormCollection formCollection) in C:\Documents and Settings\lalex\Desktop\MVCApp\MVCApp\Controllers\EventReports\EventReportsController.cs:56
   lambda_method(ExecutionScope , ControllerBase , Object[] ) +140
   System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters) +17
   System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +178
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +24
   System.Web.Mvc.<>c__DisplayClassa.<InvokeActionMethodWithFilters>b__7() +52
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +254
   System.Web.Mvc.<>c__DisplayClassc.<InvokeActionMethodWithFilters>b__9() +19
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodWithFilters(ControllerContext controllerContext, IList`1 filters, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +192
   System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +399
   System.Web.Mvc.Controller.ExecuteCore() +126
   System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +27
   System.Web.Mvc.ControllerBase.System.Web.Mvc.IController.Execute(RequestContext requestContext) +7
   System.Web.Mvc.MvcHandler.ProcessRequest(HttpContextBase httpContext) +151
   System.Web.Mvc.MvcHandler.ProcessRequest(HttpContext httpContext) +57
   System.Web.Mvc.MvcHandler.System.Web.IHttpHandler.ProcessRequest(HttpContext httpContext) +7
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +181
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75

有没有人遇到过这个错误? 它是什么意思,我该如何纠正它?

由于

1 个答案:

答案 0 :(得分:0)

http://msdn.microsoft.com/en-us/library/bb326394.aspx

听起来你有一个可能已损坏或损坏的数据库.AFAIK,你只会遇到硬件问题,或者更不可思议的是Sql Server中的一个错误。

请注意遵循他们的指示,因为DBCC CHECKDB(带有其中一个修复条款)将在需要时删除数据,以使DB再次进入正常状态。