Access return value in my class
I have a class located in my app_code folder named
myClass.cs
cmd.Parameters.AddWithValue("@USER", HttpContext.Current.Session["MYUSER"]);
cmd.Parameters.Add(new SqlParameter("@STATUS", SqlDbType.Int));
cmd.Parameters["@STATUS"].Direction = ParameterDirection.Output;
try
{
con.Open();
cmd.ExecuteNonQuery();
int status =
Convert.ToInt32(cmd.Parameters["@STATUS"].Value);
return
Convert.ToInt32(HttpContext.Current.Session["userStatus"]
= status);
I am adding the result to a session variable here but not sure if this is
the most efficient way to approach this. Is there a way I could access the
return value on the client side code without creating a session?
No comments:
Post a Comment