Problems with Timestamp with Zone Oracle type

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for universal data access
Post Reply
gala_l
Posts: 13
Joined: Tue 31 Jul 2007 04:05

Problems with Timestamp with Zone Oracle type

Post by gala_l » Tue 17 Sep 2013 21:53

Hi,
We are using Oracle type Timestamp with Zone in our database. Using UniDirectCommand and UniDirectDataAdapter we fill a dataset with columns for this type set as DateTime, Kind.LocalUnspecified. Unfortunately, the query returns the time exactly like in the database and drops the timezone (the application is windows based with class libraries). As a result dataset just decides that time zone is local which is actually wrong.
I tried to change data type Kind to UTC, it didn't change anything.
Then I tried to switch to DateTimeOffset and got casting types error.
So what is the best way to handle TimeStamp With Zone datatype with UniDirect controls?

Thank you,
Galina

gala_l
Posts: 13
Joined: Tue 31 Jul 2007 04:05

Re: Problems with Timestamp with Zone Oracle type

Post by gala_l » Thu 19 Sep 2013 22:46

I found the way around the first problem, but now I need to save dates using UniDirect components. After saving I should get something like: 01-OCT-13 09.00.00.000000000 PM UTC
I tried:
1. Set up parameters as Date or DateTime, then my date was saved as 01-OCT-13 09.00.00.000000000 PM -06:00
2. Set up parameters as TimeStampTZ, then my date was saved as 01-OCT-13 09.00.00.000000000 PM +00:00. This is better, but is there a way to save format as required?

Thank you,
Galina

Pinturiccio
Devart Team
Posts: 2192
Joined: Wed 02 Nov 2011 09:44

Re: Problems with Timestamp with Zone Oracle type

Post by Pinturiccio » Tue 24 Sep 2013 12:02

gala_l wrote:1. Set up parameters as Date or DateTime, then my date was saved as 01-OCT-13 09.00.00.000000000 PM -06:00
This is designed behaviour. You need to use a workaround to get the result you want.
gala_l wrote:2. Set up parameters as TimeStampTZ, then my date was saved as 01-OCT-13 09.00.00.000000000 PM +00:00. This is better, but is there a way to save format as required?
This is the best known workaround.

Post Reply