How to identify the custom error message raised from the sql stored procedure with c# code?
Stored Procedure the error will be raised like this
RAISERROR (N'This is message %s %d.', -- Message text.
10, -- Severity,
1, -- State,
N'number', -- First argument.
5); -- Second argument.
From the above, how to identify that the error is custom error message. (ie) Something like this
try{
--actual code here
}
catch(SqlException ex)
{
--how to check here that the exception is custom one
}