how to check return value of stroed procedure

From: Yoshitha (gudivada_kmm_at_rediffmail.com)
Date: 02/21/05


Date: Mon, 21 Feb 2005 11:19:42 +0530

Hi
i've created stored procedure in

sql server 2000 which returns a value

see the stroed procedure

CREATE PROCEDURE QA_Select_AdminOrRec
@Role varchar(50),
@username varchar(50),
@pwd varchar(50)

AS

if exists (select * from

QA_Admin_Recruiter where role = @role

and username=@username and pwd=@pwd)
return (1)
else
return (0)
GO

and in asp.net i called this stroed procedure like this

Dim username As New OleDbParameter
        username.OleDbType = OleDbType.VarChar
        username.Value = txtUserName.Text

        Dim pwd As New OleDbParameter
        pwd.OleDbType = OleDbType.VarChar
        pwd.Value = txtPassword.Text

        Dim role As New OleDbParameter
        role.OleDbType = OleDbType.VarChar
        role.Value = Session("user")

 cmd.CommandText = "QA_Select_AdminOrRec"

            cmd.Parameters.Add(role)
cmd.Parameters.Add(username)
            cmd.Parameters.Add(pwd)

           cmd.ExecuteNonQuery().

here i've to check the value returned

by stored procedure.

can anyone tell me how to write code

to capture a value which returned by

the stroed procedure.

thanx in advance
yoshitha