Assuming that this is a log table of some form, and you store the user ID and login date:
using (SqlConnection con = new SqlConnection(strConnect))
{
con.Open();
using (SqlCommand cmd = new SqlCommand("SELECT TOP 1 loginDate FROM myTable WHERE useID = @ID ORDER BY loginDate DESC", con))
{
cmd.Parameters.AddWithValue("@ID", userId);
DateTime lastLogin = (DateTime) cmd.ExecuteScalar();
}
}