问题描述
大家好,
我需要所有人的帮助,首先,我在oracle数据中创建了一个表,该表具有一些列,该列中的一个我现在创建日期格式,现在我使用oracle数据库在c#中建立连接...最后,我从中检索了所有内容使用C#编码的表格,但是当我使用asp.net排除表格中的gridview时出现一个错误,表明编码错误显示ORA-01843:不是有效的月份...请为我解决该问题.........
Good day everybody,
i need a help from everyone,First of all i create a table in oracle DATA it having a some some columns one of that column i create a date format now i getting connection in c# using oracle database...Finally i retrived everything from that table using C# coding but one error shows when i exceuted gridview in table using asp.net that coding error shows ORA-01843: not a valid month...please help me for that problem.........
推荐答案
DateTime mydts = DateTime.Now;
"... TO_DATE("+mydts.ToString("dd/MM/yyyy")+", ''DD/MM/YYYY'') ...."
在google中查找TO_DATE函数.
出于测试目的,请在Oracle中尝试以下操作:
Look up the TO_DATE function in google.
For testing purposes, try this in Oracle:
Select TO_DATE('26/02/2010', 'DD/MM/YYYY') from dual;
这会出错(ORA-01843):
this will go wrong (ORA-01843):
Select TO_DATE('02/26/2010', 'DD/MM/YYYY') from dual;
一次又一次:使用参数化查询! (在Google中查找"SQL注入".)
Again, again and again: USE PARAMETRIZED QUERIES ! (Lookup "SQL injection" in google.)
这篇关于ORA-01843:无效月份的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!