dbTalk Databases Forums  

Loading a blank Ingres date through .Net Data Provider

comp.databases.ingres comp.databases.ingres


Discuss Loading a blank Ingres date through .Net Data Provider in the comp.databases.ingres forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Dominic Merrin via DBMonster.com
 
Posts: n/a

Default Loading a blank Ingres date through .Net Data Provider - 03-08-2006 , 08:17 PM






Here is a question for those people out there using the Ingres .Net data
provider.

I am trying to retrieve a date from an instance of a IngresDataReader using
the GetDateTime method.

The problem I have is this particular date column has blanks and for some
reason the "GetDateTime" method substitues a blank with a default date of
"01/01/1970".

Just wondering if anyone else has overcome this problem and is able to load
the blank date value.


regards,

Dominic

--
Message posted via DBMonster.com
http://www.dbmonster.com/Uwe/Forums....ngres/200603/1

Reply With Quote
  #2  
Old   
Dominic Merrin via DBMonster.com
 
Posts: n/a

Default Re: Loading a blank Ingres date through .Net Data Provider - 03-08-2006 , 09:34 PM






Thanks for that info Tom.

Have tried adding it to the connection string, but I get the error message
"unknown connection string keyword 'blankdate'"

Is this what you are talking about? I have referenced the R3 Connectivity
Guide and this is how the keyword is documented. The order of connection
string components is not important is it?


regards,

Dominic

Tom M wrote:
Quote:
Here is a question for those people out there using the Ingres .Net data
provider.
[quoted text clipped - 13 lines]
You should be able to use the qualifier blankdate=null on the open
statement, but there was a problem with this on earlier versions.

Sorry I phrased that so poorly - you need to supply this information in the
connection string.

regards,

Dominic
--
Message posted via http://www.dbmonster.com


Reply With Quote
  #3  
Old   
Tom M
 
Posts: n/a

Default Re: Loading a blank Ingres date through .Net Data Provider - 03-08-2006 , 10:52 PM




"Dominic Merrin via DBMonster.com" <u9483@uwe> wrote

Quote:
Here is a question for those people out there using the Ingres .Net data
provider.

I am trying to retrieve a date from an instance of a IngresDataReader
using
the GetDateTime method.

The problem I have is this particular date column has blanks and for some
reason the "GetDateTime" method substitues a blank with a default date of
"01/01/1970".

Just wondering if anyone else has overcome this problem and is able to
load
the blank date value.

You should be able to use the qualifier blankdate=null on the open
statement, but there was a problem with this on earlier versions.

Quote:
regards,

Dominic

--
Message posted via DBMonster.com
http://www.dbmonster.com/Uwe/Forums....ngres/200603/1



Reply With Quote
  #4  
Old   
Tom M
 
Posts: n/a

Default Re: Loading a blank Ingres date through .Net Data Provider - 03-08-2006 , 10:55 PM




"Tom M" <kryios (AT) spam (DOT) comcast.net> wrote

Quote:
"Dominic Merrin via DBMonster.com" <u9483@uwe> wrote in message
news:5cf99dcb67c2e (AT) uwe (DOT) ..
Here is a question for those people out there using the Ingres .Net data
provider.

I am trying to retrieve a date from an instance of a IngresDataReader
using
the GetDateTime method.

The problem I have is this particular date column has blanks and for
some
reason the "GetDateTime" method substitues a blank with a default date
of
"01/01/1970".

Just wondering if anyone else has overcome this problem and is able to
load
the blank date value.


You should be able to use the qualifier blankdate=null on the open
statement, but there was a problem with this on earlier versions.
Sorry I phrased that so poorly - you need to supply this information in the
connection string.
Quote:

regards,

Dominic

--
Message posted via DBMonster.com
http://www.dbmonster.com/Uwe/Forums....ngres/200603/1





Reply With Quote
  #5  
Old   
Dominic Merrin via DBMonster.com
 
Posts: n/a

Default Re: Loading a blank Ingres date through .Net Data Provider - 03-09-2006 , 11:24 PM



Yep, I only have 3.0.1

I will have to wait until Ingres 2006 is released for Windows.

Another factor could be that we don't allow nulls in our date columns.
Therefore it is actually blank and not null. I have tried to use the
IsNothing function when reading the relevant column from the DataReader but
it seems to default to "01/01/1970" straight away.

When I was just messing around trying anything, I got the "01/01/0001" date
also - but that was for all columns when I used a IIF() incorrectly with an
IsNull.

Hopefully the newer version of the .Net data provider will solve my problems
with the BLANKDATE parameter

Thanks for your help.


regards,

Dominic

Tom M wrote:
Quote:
Thanks for that info Tom.

[quoted text clipped - 4 lines]
Guide and this is how the keyword is documented. The order of connection
string components is not important is it?

This keyword wasn't available until 3.0.2. If you started with an earlier
version and
upgraded, you might have run into a problem where the new .NET data provider
didn't overwrite the old one. You might need to uninstall that component
and reinstall it.

All that said, I tried loading a dataset from an ingresDataAdapter and got
the date
01/01/0001 (DateTime.Min) instead of the null I expected.

If you are loading the value from a dataReader, you probably need to test
the value for
IsNull before trying to put it into a DateTime variable because the DateTime
variable
can't represent null.

regards,

[quoted text clipped - 12 lines]

Dominic
--
Message posted via http://www.dbmonster.com


Reply With Quote
  #6  
Old   
Tom M
 
Posts: n/a

Default Re: Loading a blank Ingres date through .Net Data Provider - 03-10-2006 , 12:38 AM




"Dominic Merrin via DBMonster.com" <u9483@uwe> wrote

Quote:
Thanks for that info Tom.

Have tried adding it to the connection string, but I get the error message
"unknown connection string keyword 'blankdate'"

Is this what you are talking about? I have referenced the R3 Connectivity
Guide and this is how the keyword is documented. The order of connection
string components is not important is it?

This keyword wasn't available until 3.0.2. If you started with an earlier
version and
upgraded, you might have run into a problem where the new .NET data provider
didn't overwrite the old one. You might need to uninstall that component
and reinstall it.

All that said, I tried loading a dataset from an ingresDataAdapter and got
the date
01/01/0001 (DateTime.Min) instead of the null I expected.

If you are loading the value from a dataReader, you probably need to test
the value for
IsNull before trying to put it into a DateTime variable because the DateTime
variable
can't represent null.

Quote:
regards,

Dominic

Tom M wrote:
Here is a question for those people out there using the Ingres .Net
data
provider.
[quoted text clipped - 13 lines]
You should be able to use the qualifier blankdate=null on the open
statement, but there was a problem with this on earlier versions.

Sorry I phrased that so poorly - you need to supply this information in
the
connection string.

regards,

Dominic

--
Message posted via http://www.dbmonster.com



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.