title: Select oracle date column using C#
body: <p>I am trying to select data from my Oracle database BY DATE using C#. However I am always getting an empty data set although the same query string works just fine in Oracle SQL Developer</p>
  
  <pre><code>String Query = "Select position_date from position";
  OracleDataAdapter adapter = new OracleDataAdapter(Query, ocon); 
  adapter.Fill(ds, "table"); //where ds is a dataset 
  PrintDataSet(ds);
  </code></pre>
  
  <p>returns</p>
  
  <pre><code>3/8/2011 12:00:00 AM.... and more
  </code></pre>
  
  <p>However, when I change my query to below, then there is no output! </p>
  
  <pre><code>String Query = "Select position_date from position 
  where to_char(position_date, 'mm-dd-yyyy') = '05-17-2012'"
  </code></pre>
  
  <p>This query works fine in oracle sql developer. I've also tried trunc(sysdate) but nothing seems to work! :(</p>