Anish Khan

Anish Khan

  • NA
  • 25
  • 0

Storing sql raiserror message in c# Variables

Jun 6 2009 6:31 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(50)
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)