【发布时间】:2018-04-13 08:27:30
【问题描述】:
让我解释一下场景:我有这个代码和存储过程。
案例一:
C#代码:
try
{
call uspMyProcedure using ado.net
}
catch
{
Log exception
}
存储过程
uspMyProcedure (*without try catch*)
这种情况1,我可以知道存储过程中是否有错误,因为C#代码中捕获了异常。
案例 2:
C#代码:
try
{
call uspMyProcedure using ado.net
}
catch
{
Log exception
}
存储过程
uspMyProcedure (*with try catch*)
这种情况2,我怎么知道存储过程中是否有错误,因为异常没有在C#代码中捕获。
谢谢。
迈克
【问题讨论】:
-
存储过程中有try-catch吗?
-
@MathewPaxinos 是的,如果 try-catch 在存储过程中。
标签: c# sql-server stored-procedures error-handling try-catch