i have table Attendance having attribute
[ID],[Engi_Profile_ID],[In_Date_Time],[Out_Date_Time],[Reason],[Remark],[Flag]
When i login it insert [int],[Engi_Profile_ID] , [In_Date_Time] ,[In_Date_Only] ,
[Reason],[Remark],[Flag] is inserted but when session expire then a query is fired for update where to write it to fire the update query is it Global.asax page or web.config page how to do it.
I know what i have done is wrong.
give me write answer.
What I have tried:
void Session_Start(object sender, EventArgs e)
{
HttpContext.Current.Session("Session_Name");
id = HttpContext.Current.Session.SessionID;
SqlCommand cmd1 = new SqlCommand("Update Attendence set Out_Date_Time='" + DateTime.Now + "', Flag='Close' where Engi_PRofile_ID='" + txtID.Text + "' and Flag='Open' and Replace(Convert(Nvarchar(20),In_Date_Only,106),' ','-')=Replace(Convert(Nvarchar(20),gETDATE(),106),' ','-')", con);
cmd1.Parameters.AddWithValue("@Engi_Profile_ID", txtID.Text.ToString());
}