我有一个存储过程,它返回学生是否被锁定:
RETURN @isLocked
我执行这个存储过程,如:
public int IsStudentLocked(string studentName, int lockoutTime)
{
SqlConnection connObj = new SqlConnection();
connObj.ConnectionString = Util.StudentDataInsert();
connObj.Open();
SqlCommand comm = new SqlCommand("uspCheckLockout", connObj);
comm.CommandType = CommandType.StoredProcedure;
comm.Parameters.Add(new SqlParameter("@Studentname", studentName));
comm.Parameters.Add(new SqlParameter("@LockoutTime", lockoutTime));
comm.ExecuteNonQuery();
connObj.Close();
//How can I return the @isLocked value below?
return ((int)(@isLocked));
}