SqlConnection con = new SqlConnection("connectionstring"); SqlCommand com = new SqlCommand("insert into logintable (userID, login) values (@userid, @login)", con); com.CommandType = System.Data.CommandType.Text; com.Parameters.AddWithValue("@userid", "member user name"); com.Parameters.AddWithValue("@login", DateTime.Now); com.ExecuteNonQuery();
SqlConnection con = new SqlConnection("connectionstring"); SqlCommand com = new SqlCommand("update logintable set logout=@logout where userID=@userid and logout Is Null and sessionID=@sessionID", con); com.CommandType = System.Data.CommandType.Text; com.Parameters.AddWithValue("@userid", "member user name"); com.Parameters.AddWithValue("@logout", logoutTime); com.Parameters.AddWithValue("@sessionID", Session.SessionID); com.ExecuteNonQuery();
Hall of Fame Twitter Terms of Service Privacy Policy Contact Us Archives Tell A Friend