This discussion is archived
2 Replies Latest reply: Feb 14, 2013 5:06 AM by 991101 RSS 11 and error  message: "ORA-1843: not a valid month"

user521219 Newbie
Currently Being Moderated

I installed 11 client on my Windows 7 and try to use it with my application for database connection (Oracle 11g).

I got error: "ORA-1843: not a valid month" when trying to run code below:
string date1 = "28/02/2013";
OracleConnection conn = new OracleConnection("Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=;User Id=aspa2;Password=aspa2;");
OracleCommand cmd = new OracleCommand();
cmd.Connection = conn;
OracleParameter pmt = New OracleParameter("date1", OracleDbType.Date, 8);
pmt.Direction = ParameterDirection.Input;
cmd.Parameters.Add(pmt).Value = date1;
cmd.CommandText = "select * from MyTable where MyFieldDate=date1  ;";
On my Windows Registry (HKEY_LOCAL_MACHINE\Software\Oracle) I changed all values of key NLS_LANG to: LATIN AMERICAN SPANISH_PERU.WE8MSWIN1252 and restarted my PC.

Same web application works OK with ODP.NET 10.1, but it's not with this version 11.

Also, I tried to add this code to force recognition of date format:
OracleGlobalization sg = conn.GetSessionInfo();
sg.DateFormat = "DD/MM/YYYY";
But no success.

Is it a bug or is there a solution?


  • Correct Answers - 10 points
  • Helpful Answers - 5 points