Return Value from Stored procedure

  • Thread starter Thread starter bbawa1
  • Start date Start date
B

bbawa1

I have a stored procedure which is returning an int. Could you
pleasde give me ADO.Net code that how can I retrieve the returning
value from from stored procedure in aspx page and put that returning
value in a variable.

Thanks
 
I have a stored procedure which is returning an int. Could you
pleasde give me ADO.Net code that how can I retrieve the returning
value from from stored procedure in aspx page and put that returning
value in a variable.

There's something wrong with your newsreader - it' just posted this in a new
thread...
 
SqlComand comm = new SqlCommand(connection);
comm.Text = @"

declare @res int
execute @res = spYouStoredProcedure @YourParameter = <yourvalue>
select @res"
);
int res = comm.ExecuteScalar();
 
Back
Top