ORA-01858 error on Windows deployment server

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
dbelanger
Posts: 6
Joined: Wed 23 Sep 2009 17:24

ORA-01858 error on Windows deployment server

Post by dbelanger » Mon 22 Feb 2010 17:27

Hi there,

I'm passing in a date time like so:

Code: Select all

OracleParameter inDateTime = new OracleParameter();
inDateTime.Value = "01-01-2010";
inDateTime.ParameterName = "IN_DOI";
inDateTime.DbType = DbType.Date;
myCommand.Parameters.Add(inDateTime);
inDateTime.Direction = ParameterDirection.Input;
This works fine locally but when I put the service on my windows server (2003) I receive the error:

ORA-01858 a non-numeric character was found where a numeric was expected

Any ideas as to what I may be missing on my deployment server?

Thanks.

Shalex
Devart Team
Posts: 8086
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Tue 23 Feb 2010 12:12

It seems like the regional settings in your development and deployment environments are different. As a result, the string representation of the date is parsed using different date formats. You can apply one of the following workarounds:
1) avoid setting a date via a string and use

Code: Select all

inDateTime.Value = new DateTime(2010, 01, 01);
instead of

Code: Select all

inDateTime.Value = "01-01-2010";
2) reset the Devart.Data.Oracle.OracleGlobalization.DateFormat value in your deployment environment to override the system (default) format for your application locally.

dbelanger
Posts: 6
Joined: Wed 23 Sep 2009 17:24

Post by dbelanger » Mon 22 Mar 2010 21:44

Thanks, worked great.

Post Reply