Anish Khan

Anish Khan

  • NA
  • 25
  • 0

storing sql raiserror message in C# variables

Jun 6 2009 2:50 AM

Hi ..
I m using raiserror function in sql server stored procedure  to print error message ...
and also I want to store this error message in c# .Net variables.
Query will look like ....
declare
@err varchar(5)
select
distinct * from Mytesttablebackup
set
@err=@@error
if
@err <>0
Raiserror
('details not found',100,@err)
can i store this raiserror message in C# like
string mess="";
mess=raiserror;
If yess then how
Thanks..
 

Answers (1)