I have a stored procedure for getting last row value of a UserId
:
ALTER PROCEDURE [dbo].[get_LoginStatusQ]
@UserId int
AS
BEGIN
SELECT MAX(UserTimeId), LoginStatus
FROM UserTime
WHERE UserId = @UserId
GROUP BY UserId, LoginStatus, Day, HoursWorked, Date, CheckIn,UserTimeId
END
In C#, I want to get the value of LoginStatus. How to do I do this?
I tried:
public void GetLogin(object sender, EventArgs e)
{
db.get_LoginStatusQ(Convert.ToInt32(Session["userid"])));
if( LoginStatus ='In') // How do I get the field LoginStatus from the database?
{
}
}