title: firebird database query with date time
body: <p>I am trying to execute a query against a Firebird database using c# and don't have something quite right.  Note that I am executing these query against employee.fdb database example you get when installing Firebird.</p>
  
  <p>The following works.</p>
  
  <pre><code>string query = @"SELECT EMPLOYEE.HIRE_DATE
  FROM EMPLOYEE
  WHERE HIRE_DATE &gt; '02.01.1990, 03.04.05.000'";
  
  using (FbConnection connection = new FbConnection(connectionString))
  using (DataContext db = new DataContext(connection))
  {
      List&lt;employee&gt; results = db.ExecuteQuery&lt;employee&gt;(query).ToList();
  }
  </code></pre>
  
  <p>If I parameterize the date.</p>
  
  <pre><code>string query = @"SELECT EMPLOYEE.HIRE_DATE
  FROM EMPLOYEE
  WHERE HIRE_DATE &gt; {0}";
  
  using (FbConnection connection = new FbConnection(connectionString))
  using (DataContext db = new DataContext(connection))
  {
      List&lt;employee&gt; results = db.ExecuteQuery&lt;employee&gt;(query, "02.01.1990, 03.04.05.000").ToList();
  }
  </code></pre>
  
  <p>I get a System.FormatException: String was not recognized as a valid DateTime.</p>
  
  <p>And what I would really like to do is just use a DateTime object.</p>
  
  <pre><code>string query = @"SELECT EMPLOYEE.HIRE_DATE
  FROM EMPLOYEE
  WHERE HIRE_DATE &gt; {0}";
  
  using (FbConnection connection = new FbConnection(connectionString))
  using (DataContext db = new DataContext(connection))
  {
      DateTime a = new DateTime(1990, 1, 2, 3, 4, 5);
      List&lt;employee&gt; results = db.ExecuteQuery&lt;employee&gt;(query, a).ToList();
  }
  </code></pre>
  
  <p>But then I get a System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.</p>
  
  <p>Anybody know how I can use a DateTime as a parameter to the query?</p>