The Error ORA-01830: date format picture ends before converting entire input string

Today, I find a error in my project, that display  "ORA-01830: date format picture ends before converting entire input string "

Reason: My operation is Windows XP Enu, but others are Windows XP CH. In my operation, the default datetime format is 'dd/mm/yyyy'.
The follow sql string 

string DateTimeStr = DataTime.Now.ToShortDateString();
"select   * from a where time<to_date('"+DateTimeStr+"','yyyy-mm-dd')"  

when I excute the sql string, The ORA-01830 error will be occure,

to fix the prolem, you should be replace the ToShortDateString() method by ToString('yyyy-mm-dd')

and other soulations are finding .

Thanks, Good Luck!

posted on 2007-04-04 10:10  广思  阅读(8368)  评论(6)    收藏  举报

导航