N
Nilay Shah
Hi,
I am executing stored procedure (which is deleting the
records) with the help of Execute non query. While
passing the parameters, also have specified one parameter
as return parameter as.
param.Direction = ParameterDirection.ReturnValue;
In the stored procedure (DB SQL Server 2000) after delete
statement I have specified code as
delete from <table> where <condition>
if @@error <> 0
return -1
else
return 0
I was expecting that if delete fails then it would return -
1 else it would return 0.. but instead of that it is going
in exception.. I am not sure if this is the expected
behaviour of executenonquery.
If this is the case then I have a question that where
should I identify business error and exception.. as if
delete is failed then i would get exception and so is if
database is down.. so how to differentiate??
Kindly help.
Thanks and regards,
Nilay.
I am executing stored procedure (which is deleting the
records) with the help of Execute non query. While
passing the parameters, also have specified one parameter
as return parameter as.
param.Direction = ParameterDirection.ReturnValue;
In the stored procedure (DB SQL Server 2000) after delete
statement I have specified code as
delete from <table> where <condition>
if @@error <> 0
return -1
else
return 0
I was expecting that if delete fails then it would return -
1 else it would return 0.. but instead of that it is going
in exception.. I am not sure if this is the expected
behaviour of executenonquery.
If this is the case then I have a question that where
should I identify business error and exception.. as if
delete is failed then i would get exception and so is if
database is down.. so how to differentiate??
Kindly help.
Thanks and regards,
Nilay.