title: Showing Date only from SQL Database
body: <p>I am sending <strong>Date</strong> from <strong>WPF</strong> to <strong>ModelClass</strong> by this method....... </p>
  
  <pre><code>private void buttonNTSave_Click(object sender, RoutedEventArgs e)
  {
      ModelClass model = new ModelClass();
      model.TaskInsertion(textBoxNTSubject.Text, textBoxNTType.Text, Convert.ToDateTime(datePickerNT.SelectedDate), textBoxNTTitle.Text, textBoxNTDetail.Text);
  }
  </code></pre>
  
  <p>The <strong>Date</strong> is being inserted in database by this method...</p>
  
  <pre><code>public void TaskInsertion(string subject, string type, DateTime dueDate, string title, string detail)
  {
      SqlConnection conn = new SqlConnection(connectionString);
      try
      {
          string query = "INSERT INTO Tbl_Task (Email, Subject, Type, DueDate, Title, Detail) VALUES ('" + userEmail + "', '" + subject + "' , '" + type + "', '" + dueDate.Date + "', '" + title + "', '" + detail + "')";
  
          SqlCommand cmd = new SqlCommand(query, conn);
          conn.Open();
          cmd.ExecuteNonQuery();
      }
  
      catch (Exception e)
      {
          conn.Close();
      }
  }
  </code></pre>
  
  <p>But Whenever I try to retrieve only <strong>Date</strong> from Database to a <strong>DataGrid</strong>, still the <strong>Time</strong> with <strong>Date</strong> is showing..</p>
  
  <pre><code>public DataTable OverDueCurrentTask()
  {
  
      SqlConnection conn = new SqlConnection(connectionString);
      try
      {
  
          DateTime DateToday = DateTime.UtcNow.Date;
          string query = "DECLARE @sDate Date SET @sDate = '" + DateToday.Date + "' SELECT Title, Subject, Type, DueDate FROM Tbl_Task WHERE DueDate &gt;= @sDate";
  
          SqlCommand cmd = new SqlCommand(query, conn);
          conn.Open();
          cmd.ExecuteNonQuery();
  
          SqlDataAdapter dataAdp = new SqlDataAdapter(cmd);
          DataTable dataTbl = new DataTable("Tbl_Task");
          dataAdp.Fill(dataTbl);
          dataAdp.Update(dataTbl);
          return dataTbl;
  
      }
  
      catch (Exception e)
      {
  
          conn.Close();
          return null;
  
      }
  }
  </code></pre>
  
  <p>How to show <strong>Date</strong> without showing the <strong>Time</strong>?
  N.B. In Database, DueDate is a Date Type column.</p>