朋友们...
在我的 ms 访问数据库中,我存储日期格式 dd-MMM-yy。并在搜索查询中将日期作为参数传递。但是我的系统不能包含日期格式 mm/dd/yyyy 所以,我如何在将这个日期传递给现在查询之前将此格式转换为 dd-MMM-yy,我使用以下代码..但给出错误....字符串无法识别作为有效的日期时间。
DateTime dt = DateTime.ParseExact(startdate.ToString(), "dd-MMM-yy",
CultureInfo.InvariantCulture);//startdate is datepicker
询问...
s = new OleDbDataAdapter("
SELECT opd_patient_master.*, patient_operation.*
FROM opd_patient_master, patient_operation
WHERE opd_patient_master.pid= patient_operation.pid
and opd_patient_master.rdid= patient_operation.rdid
and odate >= #" + startdate + "# and odate<=# " + enddate + "#
and operation= '" + oprtype + "'", mycon);