친구 ... 내 MS 액세스 데이터베이스에구문 분석 날짜는
은 내가 날짜 형식 DD-MMM-YY를 저장합니다. 및 검색어에서 매개 변수로 날짜를 전달합니다. 하지만 내 시스템은 날짜 형식 mm/dd/yyyy 입니다. dd-MMM-yy에서이 형식을 변환하려면 어떻게해야합니까? 쿼리에이 날짜를 전달하기 전에 지금 folling code ..but 오류를 사용합니다 .... String 유효한 DateTime으로 인식되지 않았습니다.
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);
와'enddate' 현재의 접근 방식에 대한
는, 해결책은 문자열로 날짜를 통과, 표준 ISO 날짜 포맷 YYYY-MM-DD를 사용하는 것입니다 또한 'DateTimePicker'입니까? –