"AVAILABLEDATE" is a column of type DATE.
I can query the table via Toad and get results. However, in (Winforms/C#/dotConnect) code, it's not working.
ocmd.Parameters.Add("AVAIL_DATE", getDateToQuery());
I'm pretty sure the problem is the way I'm passing the date:
private DateTime getDateToQuery() {
DateTime candidateVal = dateTimePickerScheduleDate.Value;
if (candidateVal.Equals(null)) {
candidateVal = DateTime.Now;
}
return candidateVal;
}
...but I don't know how to force the date value to be in the format Oracle will recognize.
This works, but I'm not sure it's the best way:
int iFromYear = dateTimePickerScheduleDate.Value.Year;
int iFromMonth = dateTimePickerScheduleDate.Value.Month;
int iFromDay = dateTimePickerScheduleDate.Value.Day;
. . .
ocmd.Parameters.Add("AVAIL_DATE", new DateTime(iFromYear, iFromMonth, iFromDay));