title: DateFormat issue using linq query(between)
body: <p>I am using between query in linq. The scenario is that i select start date and end date and want to retrieve the data between these dates. On the local system its working fine but when i deployed it on server it was throwing exception.</p>
  
  <blockquote>
    <p>String was not recognized as a valid DateTime.</p>
  </blockquote>
  
  <p>Data which need to be entered in the textboxes format: <strong>04/01/2015</strong></p>
  
  <p>Data stored in database format: <strong>2013-10-23 12:35:56.593</strong></p>
  
  <pre><code>protected void _btnSearch_Click(object sender, EventArgs e)
      {
          using (DataClassesCABEEDataContext db = new DataClassesCABEEDataContext())
          {
              var query = (from a in db.Jobs where 
                           (a.Job_DateTime &gt;= Convert.ToDateTime(_txtFrom.Text)
                           &amp;&amp; a.Job_DateTime &lt;= Convert.ToDateTime(_txtTo.Text)) //using add watch here
                           select new
                           {
                               Reference = a.Job_No,
                               Booking_Time = a.Job_DateTime.Value.ToString("HH:mm", CultureInfo.CurrentCulture),                                 
                               Cust_Name = a.CustName,                                 
                               Price = a.Price,                             
                           });
  
              GridView1.DataSource = query;
              GridView1.DataBind();
          }  
      }
  </code></pre>
  
  <p>On debugging the code when i use add watch in the commented line of code above it throws the exception. _txtTo.Text throws this exception. When swapped the textboxes between each other like placed _txtTo.text at _txtFrom.text place and vice versa then it threw exception on _txtFrom.text. In comparison the first part gets the date but the second does not.</p>