M
mttc
I ask it before and I got this answer:
======================================================
yes errors with a certain severity level will throw exceptions in your
code
try this in your stored proc
RAISEERROR(N'This is a message %s %d', -- message text
16, --severity
1, --state
N'number', --first argument
5); --second argument
and in your code you can get this error message in the SqlException
object
--
Misbah Arefin
https://mcp.support.microsoft.com/profile/MISBAH.AREFIN
http://www.linkedin.com/in/misbaharefin
=======================================================
I have to ask more:
the built-in errors have high level for breack the SP and throw it
to .NET?
if have, How I trap this error in SP to rollback my transaction or do
somthing else within the SP instead thorow it immediately to .NET?
======================================================
yes errors with a certain severity level will throw exceptions in your
code
try this in your stored proc
RAISEERROR(N'This is a message %s %d', -- message text
16, --severity
1, --state
N'number', --first argument
5); --second argument
and in your code you can get this error message in the SqlException
object
--
Misbah Arefin
https://mcp.support.microsoft.com/profile/MISBAH.AREFIN
http://www.linkedin.com/in/misbaharefin
=======================================================
I have to ask more:
the built-in errors have high level for breack the SP and throw it
to .NET?
if have, How I trap this error in SP to rollback my transaction or do
somthing else within the SP instead thorow it immediately to .NET?