title: database is not update to true based on datetime c#
body: <p>I have a code that needed to update to true in database after one hour the browser is open but the thing is the database is not updated to True (by default it is false). Please help me figure out the error. I am new to C# .</p>
  
  <pre><code>DateTime dtt = DateTime.Now.AddHours(1);
  //after 1 hour update to true
  if(DateTime.Now &gt; dtt)
  {
      try
      {
          SqlConnection connection = new SqlConnection("....");
  
          string selectQuery = @"UPDATE tester SET have_test = 'T'";
          connection.Open();
          SqlCommand command = new SqlCommand(selectQuery, connection);
          command.ExecuteNonQuery();
  
      }
      catch (Exception ex)
      {
          MessageBox.Show(ex.Message);
      }
  }
  else
  {
      try
      {
          SqlConnection connection = new SqlConnection("...");
  
          string selectQuery = @"UPDATE tester SET have_test = 'F'";
          connection.Open();
          SqlCommand command = new SqlCommand(selectQuery, connection);
          command.ExecuteNonQuery();
  
      }
      catch (Exception ex)
      {
          MessageBox.Show(ex.Message);
      }
  }
  </code></pre>