title: C# Fill Datagridview Between 2 Datetimepicker selected value
body: <p>Below these code is what i've tried to achieve these but unfortunately i failed to do that, that's why i'm here. I really need help guys in solving these problem of mine. </p>
  
  <p>Expected Output:<br>
  If user select a date between two datetimepicker, for example is from Sep 1 to Sep 21, so the row with the date of Sep 1 to 21 will be only displayed.</p>
  
  <p>Nothing Happens here below these code.</p>
  
  <p>NOTE:</p>
  
  <ul>
  <li><p>DateReturn and DateReturn2 is both datetimepicker, the first one is DateReturn                       </p>
  
  <pre><code>public partial class SIMSSupplier : UserControl
  {
  ADDSupplier supply;
  ADDPReturns returns;
  public SIMSSupplier()
  {
      InitializeComponent();
  
  }
  public DataTable dbdataset;
  public void CustomDatetime()
  {
      var now = DateTime.Now;
      var first = new DateTime(now.Year, now.Month, 1);
      var last = first.AddMonths(1).AddDays(-1);
      DateReturn.Value = new DateTime(now.Year, now.Month, 1);
      DateReturn2.Value = last;
  }
  public void ReturnDetails()
  {
      FillSupplier(PurchaseReturn, "Select ReturnID, Supplier, Itemdescription, Modelno, Srp, Code, Date, Remarks from Purchase_Return");
  }
  private void FillSupplier(DataGridView grid, string request)
  {
      using (var con = SQLConnection.GetConnection())
      using (var select = new SqlCommand(request, con))
      using (var sda = new SqlDataAdapter())
      {
          dbdataset = new DataTable();
          sda.SelectCommand = select;
          sda.Fill(dbdataset);
          grid.DataSource = new BindingSource() { DataSource = dbdataset };
          sda.Update(dbdataset);
      }
  }
   private void SIMSSupplier_Load(object sender, EventArgs e)
   {           
      ReturnDetails();
      CustomDatetime();
   }
   private void DateReturn2_ValueChanged(object sender, EventArgs e)
   {
      using (var con = SQLConnection.GetConnection())
      {
          using (var select = new SqlCommand("Select * from Purchase_Return where Date between '" + DateReturn.Value.ToString() + "' and '" + DateReturn2.Value.ToString() + "'", con))
          {
              using (var sd = new SqlDataAdapter(select))
              {
                  var dv = new DataView(dbdataset);
                  PurchaseReturn.DataSource = dv;
              }
          }
      }
   }
  }
  </code></pre></li>
  </ul>
  
  <p><a href="https://i.stack.imgur.com/uAePr.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uAePr.jpg" alt="enter image description here"></a>
  I tried to select Sept 22, but nothing happen</p>