代码错误如何处理 [英] Error in code How to handle
本文介绍了代码错误如何处理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
!!!从Hdr_AccountType.Procedure
或函数"sproc_Ins_PhotoSettingsDetailses
"获取数据时发生错误,期望参数"@Startdate
"(未提供).
!!! An Error Occured While getting Data From Hdr_AccountType.Procedure
or function ''sproc_Ins_PhotoSettingsDetailses
'' expects parameter ''@Startdate
'', which was not supplied.
Line 307: catch (Exception ex)
Line 308: {
Line 309: throw new ApplicationException(
Line 310: "!!! An Error Occured While getting Data From Hdr_AccountType." + ex.Message);
Line 311: lblError.Visible = true;
推荐答案
在调用存储过程时,您是否在传递起始日期的日期?
异常处理程序很好,它将阻止应用程序完全崩溃,但是,IMO,您应该查看为什么会发生实际错误,而不是简单地处理它.
While calling your stored procedure, are you passing in a date for the start date?
The exception handler is fine and will stop the application from crashing completely, however, IMO, you should look at why the actual error occur rather than simply handling it.
您的存储过程需求 @Startdate
Page后面的代码未提供该代码,请检查您的@startDate
值是否到来
your stored procedure needs @Startdate
which is not supplied from your code behind Page check your@startDate
value is coming or not
这篇关于代码错误如何处理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文