title: error when generating gridview
body: <p>hye, i'm having a problem when i'm inserting data in textbox.the problem is when i'm searching for data 10/10/2010, it work perfectly but when i try to search other date (eg 25/11/2013), i would get error The conversion of a varchar data type to a datetime data type resulted in an out-of-range value.  the error occur at "gridmaxdata.DataBind();"</p>
  
  <pre><code>protected void searchdata_Click(object sender, EventArgs e)
  {
      data();
      byday2();
  }
  
  public void data()
  {
      if (Dayrange.Checked == true)
      {
          startdate = DateTime.ParseExact(txtStart1.Text, "dd/MM/yyyy", CultureInfo.InvariantCulture);
          enddate = DateTime.ParseExact(txtEnd1.Text, "dd/MM/yyyy", CultureInfo.InvariantCulture);
          //starttime = DateTime.ParseExact(txtStart1.Text, "HH:mm:ss", CultureInfo.InvariantCulture);
          //endtime = DateTime.ParseExact(txtStart1.Text, "HH:mm:ss", CultureInfo.InvariantCulture);
          Label1.Text = startdate.ToShortDateString();
          Label2.Text = enddate.ToShortDateString();
      }
      if (Byday.Checked == true)
      {
          startdate = DateTime.ParseExact(txtStart1.Text, "dd/MM/yyyy", CultureInfo.InvariantCulture);
          enddate = startdate.AddDays(1);
          //starttime = DateTime.ParseExact(txtStart1.Text, "HH:mm:ss", CultureInfo.InvariantCulture);
          //endtime = DateTime.ParseExact(txtStart1.Text, "HH:mm:ss", CultureInfo.InvariantCulture);
          Label1.Text = startdate.ToShortDateString();
          Label2.Text = enddate.ToShortDateString();
      }
  
  }
  
  public void byday2()
  {
  
      if (Byday.Checked == true)
      {
          if (Maxdata.Checked == true)
          {
              //tablemax.hidden = true;
              lblmaxdata.Visible = true;
              lblmaxdata.Text = "Highest Data";
              // ConnectionString to NorthWind Database.
              string connectionString = "Data Source=.\\SQLEXPRESS;AttachDbFilename=C:\\Users\\shafiq\\Desktop\\history\\App_Data\\Radiation.mdf;Integrated Security=True;User Instance=True";
  
              // Create SQLDataSource.
              SqlDataSource sqlDataSource = new SqlDataSource();
              sqlDataSource.ID = "SqlDataSource123";
              this.Page.Controls.Add(sqlDataSource);
  
              // Bind ConnectionString to SQLDataSource.
              sqlDataSource.ConnectionString = connectionString;
              // Retrieve records with only 5 Columns from Employees table of NorthWind Database.
              sqlDataSource.SelectCommand = "SELECT [date], [data] FROM [loc1] WHERE (([data] &gt;= '2') AND ([date] &gt;= '" + Convert.ToDateTime(startdate).ToString("dd/MM/yyyy") + "') AND ([date] &lt; '" + Convert.ToDateTime(enddate).ToString("dd/MM/yyyy") + "')) ORDER BY [data] DESC, [date] DESC";
  
              // Bind SQLDataSource to GridView after retrieving the records.
              gridmaxdata.DataSource = sqlDataSource;
              gridmaxdata.DataBind();
          }
      }
  }
  </code></pre>