Getting operation in not valid error when doing ExecuteScalar() to return a date. No errors on compile and I'm not sure why this isn't working - message is not helping me understand. Any thoughts?
using (OracleConnection con = new OracleConnection(----------)
{
using (OracleCommand cmd = new OracleCommand())
{
con.Open();
cmd.CommandText = "select end_date from calendar where :today >= begin_date and :today <= end_date";
DateTime today = DateTime.Today;
cmd.Parameters.Add(":today", OracleDbType.Date).Value = today;
try
{
DateTime ppEndDate = (DateTime)cmd.ExecuteScalar();
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
}
}