The below statement is causing System.InvalidCastException: Specified
cast is not valid. Can anyone see what is going wrong with this and
help me out.
string statement =
Convert.ToString("Select ConfNum from Call" +
" where AcctNo = '" + r["AcctNo"] + "'" +
" AND BegDate = '" + DateOfCall + "'" +
" AND (BegTime between '" + ((DateTime)r["BegDate"]).TimeOfDay + "'"
+
" AND '" + ((DateTime)r["BegDate"]).AddMinutes(30).TimeOfDay +
"')" +
" OR (BegTime between '" + ((DateTime)r["BegTime"]) + "'" +
" AND '" + ((DateTime)r["BegTime"]).AddMinutes(30) + "'");
Thanks,
IndyChris