title: convert Request.QueryString toDatetime and then fetch using datacontext in linq in c# asp.net
body: <p>I wanna get the Timedate value from another page using request.querystring and then use it an query to compare and pull up the matching datas. The function for the query in linq is:</p>
  
  <pre><code>   protected void User_Querytime()
      {
      DataClasses2DataContext dc1 = new DataClasses2DataContext();
      String  Data = Request.QueryString["TimeOfMessage"];
  
                  var query7 = from u in dc1.syncback_logs
                               where u.TimeOfMessage = Data
                               orderby u.TimeOfMessage descending
                               select u;
                  GridView1.DataSource = query7;
                  GridView1.DataBind();
      }
  </code></pre>
  
  <p>Here the "Request.QueryString["TimeOfMessage"]" which i get is DateTime (ex:8/25/2008 9:07:19 AM). I wanted to compare it against the "u.TimeOfMessage" in database and pull up the matching records. </p>
  
  <p>When I use todatetime function to convert from string to datetime ,the value returned is bool and hence not able to compare it against the "Timeofmessage" which is datetime format in database. Can anyone help me in this?</p>