asp.net - ORA-01861: literal does not match format string","StackTrace":" at System.Data.OleDb.OleDbCommand.ExecuteCommandTextErrorHandling(OleDbHResult hr) -
select prodescription.pdc_desc,prodescription.pd_code  billdetl,billmast,prodescription  billdetl.bmc_slno=billmast.bmc_slno    , prodescription.pd_code=billdetl.pd_code    , billmast.pt_no='" + hospitalno + "'    , billdetl.original_oucode='l002'    , to_date(billmast.bmd_date,'dd/mm/yy')      =to_date('" + visitdate.toshortdatestring() + "','dd/mm/yy')"   above query works in oracle error occurred when connected oracle using asp.net oledb connection
it seem oledb connection done machine locale not return date format you're expecting locale dependent toshortdatestring().
try replacing visitdate.toshortdatestring() fixed - non locale dependent - date format, like;
and trunc(billmast.bmd_date, 'day')    =to_date('" + visitdate.tostring("dd\\/mm\\/yy") + "','dd/mm/yy')"      
Comments
Post a Comment