I agree with Mika that using parameters in your query is the way to go, but if you have to put the dates in as inline text, render them as ISO standard datetimes so that SQL will recognize them correctly:
select * from OUTLOOK_DETAIL
where RECEIVE_TIME between
'" + Program.datefrom.ToString("yyyy-MM-dd HH:mm:ss") + "'
and
'" + Program.dateto.ToString("yyyy-MM-dd HH:mm:ss") + "'
order by RECEIVE_TIME
or if it only the date part:
select * from OUTLOOK_DETAIL
where RECEIVE_TIME between
'" + Program.datefrom.ToString("yyyy-MM-dd") + "'
and
'" + Program.dateto.ToString("yyyy-MM-dd") + "'
order by RECEIVE_TIME