title: How to fill all dates of selected month in DataTable
body: <p>I am trying to fill all dates of a selected month in a DataTable. I have done like below mentioned method but its not working.  </p>
  
  <pre><code>public DataTable  GetDates()
  {
  DataTable dt = new DataTable();
  int year = Convert.ToInt32(ddyear.SelectedItem.Value);//I selected year 2015
  int month = Convert.ToInt32(ddmonth.SelectedItem.Value);//I selected  month 3
  for ( date = new DateTime(year, month, 1); date.Month == month; date =    date.AddDays(1))
  {
    dt.Rows.Add(date);
    date = date.AddDays(1);
  }
  return dt;
  }
  </code></pre>
  
  <p>How can I do it??</p>