vb.net – 超时已过期. *** 作完成之前经过的超时时间或服务器没有响应

vb.net – 超时已过期. *** 作完成之前经过的超时时间或服务器没有响应,第1张

概述我不确定这是VB.NET错误还是SQL Server.但我得到以下错误与以下堆栈跟踪: [SqlException (0x80131904): Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.] System.Data.S 我不确定这是VB.NET错误还是sql Server.但我得到以下错误与以下堆栈跟踪:

[sqlException (0x80131904): Timeout
expired. The timeout period elapsed
prior to completion of the operation
or the server is not responding.]
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,
Boolean returnStream,Boolean async)
+954 System.Data.sqlClIEnt.sqlCommand.RunExecuteReader(CommandBehavior
cmdBehavior,String method,
DbAsyncResult result) +162
System.Data.sqlClIEnt.sqlCommand.RunExecuteReader(CommandBehavior
cmdBehavior,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.System.Data.IDbCommand.ExecuteReader(CommandBehavior
behavior) +10
System.Data.Common.DbDataAdapter.Fillinternal(DataSet
dataset,Datatable[] datatables,Int32
startRecord,Int32 maxRecords,String
srctable,IDbCommand command,
CommandBehavior behavior) +130
System.Data.Common.DbDataAdapter.Fill(DataSet
dataSet,Int32 startRecord,Int32
maxRecords,String srctable,
IDbCommand command,CommandBehavior
behavior) +287
System.Data.Common.DbDataAdapter.Fill(DataSet
dataSet) +94
GlobalFunctions.GlobalF.GetComplaintTrendingList6(DateTime
FirstMonth,DateTime LastMonth,Int32
rowLevel) +489
ASP.website_complaints_complainttrendingList6_aspx.Main()
in
e:\inetpub\amdmetrics-d.web.abbott.com\wwwroot\Website\Complaints\ComplaintTrendingList6.aspx:94
ASP.website_complaints_complainttrendingList6_aspx.Page_Load(Object
Sender,EventArgs E) in
e:\inetpub\amdmetrics-d.web.abbott.com\wwwroot\Website\Complaints\ComplaintTrendingList6.aspx:60
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr
fp,Object o,Object t,EventArgs e)
+14 System.Web.Util.CallIEventHandlerDelegateProxy.Callback(Object
sender,EventArgs e) +35
System.Web.UI.Control.OnLoad(EventArgs
e) +99
System.Web.UI.Control.LoadRecursive()
+50 System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint,Boolean
includeStagesAfterasyncPoint) +627

这是在Microsoft .NET Framework版本:2.0.50727.3620; ASP.NET版本:2.0.50727.3618和sql Server 2008.
它标记导致此错误的行说:

1: PrintMessageGrID.DataSource = GlobalFunctions.GlobalF.GetComplaintTrendingList6(FirstMonthDate,LastMonthDate,TheLevel)

即使我可以在查询分析器中运行此存储过程,它将在8秒后返回.可能是什么原因和修复?

这里是我声明这个函数的更多细节:

Public Shared Function GetComplaintTrendingList6(ByVal FirstMonth As DateTime,ByVal LastMonth As DateTime,ByVal rowLevel As Integer) As DataSet    Dim DSPageData As New System.Data.DataSet    Dim param(2) As sqlClIEnt.sqlParameter    param(0) = New sqlParameter("@FirstMonthDate",sqlDbType.DateTime)    param(0).Value = FirstMonth    param(1) = New sqlParameter("@LastMonthDate",sqlDbType.DateTime)    param(1).Value = LastMonth    param(2) = New sqlParameter("@TheLevel",sqlDbType.Int)    param(2).Value = rowLevel    ''# A Using block will ensure the .dispose() method is called for these variables,even if an exception is thrown     ''# This is important - not disposing your connections properly can result in an unrespsonsive database     Using conn As New sqlConnection(ConfigurationSettings.AppSettings("AMDMetricsDevConnectionString")),_   cmd As New sqlCommand("ComplaintTrendingList6",conn),_    da As New sqlDataAdapter(cmd)        cmd.CommandType = CommandType.StoredProcedure        cmd.Parameters.AddRange(param)        da.Fill(DSPageData)    End Using    Return DSPageDataEnd Function

奇怪的是,如果我在存储过程中进行了这么小的改动,它会通过,但不会给我我想要的数据:
没错,但这个版本没有给我我想要的东西:

SELECT E.PRODUCT_GROUP,a.QXP_SHORT_DESC,COUNT(disTINCT A.QXP_EXCEPTION_NO),A.QXP_REPORT_DATE,DATEADD(M,DATEDIFF(M,A.QXP_REPORT_DATE),0) AS STARTDATEFROM ALL_COMPLAINTS Aleft OUTER JOIN SMARTSolVE.V_QXP_ISSUE_REF D ON A.QXP_ID = D.IRF_QXP_ID INNER JOIN CT_ProductFailures b ON b.old_modes = a.qxp_short_descleft OUTER JOIN [MANUAL].PRODUCTS E ON A.EPA_PRD_CODE = E.List_NUMBER left JOIN SMARTSolVE.V_CXP_CUSTOMER_PXP C ON A.QXP_ID = C.QXP_IDINNER JOIN @SelectedLevels F ON A.[LEVEL] = F.LevelIDWHERE   --[LEVEL] > 0 AND(A.QXP_SHORT_DESC <> 'Design Control') and A.QXP_REPORT_DATE >= @OneYearago AND A.QXP_REPORT_DATE <= @LastMonthDateAND (C.QXP_EXCEPTION_TYPE <> 'Non-Diagnostic' OR C.QXP_EXCEPTION_TYPE IS NulL)  GROUP BY E.PRODUCT_GROUP,A.QXP_SHORT_DESC

导致错误的存储过程:

INSERT #PVAL_NUMSELECT E.PRODUCT_GROUP,b.new_modes 'QXP_SHORT_DESC',0) AS STARTDATEFROM ALL_COMPLAINTS Aleft OUTER JOIN SMARTSolVE.V_QXP_ISSUE_REF D ON A.QXP_ID = D.IRF_QXP_ID INNER JOIN CT_ProductFailures b ON b.old_modes = a.qxp_short_descleft OUTER JOIN [MANUAL].PRODUCTS E ON A.EPA_PRD_CODE = E.List_NUMBER left JOIN SMARTSolVE.V_CXP_CUSTOMER_PXP C ON A.QXP_ID = C.QXP_IDINNER JOIN @SelectedLevels F ON A.[LEVEL] = F.LevelIDWHERE   --[LEVEL] > 0 AND(A.QXP_SHORT_DESC <> 'Design Control') and A.QXP_REPORT_DATE >= @OneYearago AND A.QXP_REPORT_DATE <= @LastMonthDateAND (C.QXP_EXCEPTION_TYPE <> 'Non-Diagnostic' OR C.QXP_EXCEPTION_TYPE IS NulL)GROUP BY E.PRODUCT_GROUP,b.new_modes
解决方法 您使用查询分析器(或SSMS,现在)以及您的应用程序获得的内容可能是非常不同的,主要是由于参数嗅探.

我建议阅读Erland Sommarskog的this article了解详情.

总结

以上是内存溢出为你收集整理的vb.net – 超时已过期. *** 作完成之前经过的超时时间或服务器没有响应全部内容,希望文章能够帮你解决vb.net – 超时已过期. *** 作完成之前经过的超时时间或服务器没有响应所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/langs/1250629.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-07
下一篇 2022-06-07

发表评论

登录后才能评论

评论列表(0条)

保存