Re: ADO and timestamp/date errors

From: Jonel Rienton <jonel(at)road14(dot)com>
To: "Craig Bryden" <postgresql(at)bryden(dot)co(dot)za>
Cc: "Shachar Shemesh" <psql(at)shemesh(dot)biz>, "pgsql" <pgsql-general(at)postgresql(dot)org>
Subject: Re: ADO and timestamp/date errors
Date: 2005-02-23 21:09:08
Message-ID: 264253b01e57e168ae59710d11cdfe11@road14.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi Craig,

Out of curiosity, beside portability, why haven't you use Npgsql?

regards,

-----
Jonel Rienton
http://blogs.road14.com
Software Developer, *nix Advocate
On Feb 23, 2005, at 1:48 PM, Craig Bryden wrote:

> Hi Shachar
>
> Unfortunately due to a Non disclose agreement that I have on the
> project, I
> cannot send the whole table creation statement. But I have included
> some
> fields below:
> CREATE TABLE tb_Player (
> PlayerID SERIAL NOT NULL PRIMARY KEY ,
> Firstname varchar (100) NOT NULL ,
> Lastname varchar (100) NOT NULL ,
> Initials varchar (15) NULL ,
> EMail varchar (255) NOT NULL ,
> DateCreated timestamp NOT NULL DEFAULT current_timestamp
> ) WITHOUT OIDS;
>
> The C# code is:
> string connString = "Location=MyDB;Provider=\"PostgreSQL.1\";User
> ID=XXX;Data Source=localhost;Extended Properties=;Password=XXX";
> System.Data.OleDb.OleDbConnection dbConn = new
> System.Data.OleDb.OleDbConnection(connString);
> dbConn.Open();
> DSet1 = new DataSet();
> System.Data.OleDb.OleDbCommand comm = new
> System.Data.OleDb.OleDbCommand("select datecreated from
> pr_GetPlayerByID(2500 )",dbConn);
> System.Data.OleDb.OleDbDataAdapter da = new
> System.Data.OleDb.OleDbDataAdapter(comm);
> DataTable dt = new DataTable("Table1");
> DSet1.Tables.Add(dt);
> da.Fill(DSet1.Tables["Table1"]);
> dgResults.DataSource = DSet1;
> dgResults.DataMember = "Table1";
>
> The type that is returned by the function is:
> CREATE TYPE pr_getplayerbyid_returntype AS
> (playerid int4,
> firstname varchar(100),
> lastname varchar(100),
> initials varchar(15),
> email varchar(255),
> datecreated timestamp);
>
> Thanks
> Craig
>
> ----- Original Message -----
> From: "Shachar Shemesh" <psql(at)shemesh(dot)biz>
> To: "Craig Bryden" <postgresql(at)bryden(dot)co(dot)za>
> Cc: "pgsql" <pgsql-general(at)postgresql(dot)org>
> Sent: Tuesday, February 22, 2005 9:26 PM
> Subject: Re: [GENERAL] ADO and timestamp/date errors
>
>
>> Craig Bryden wrote:
>>
>>> Hi Shachar
>>>
>>> I have confirmed that I am running the latest version.
>>> The error that I get (in ADO .Net) is :
>>>
> ***********************************************************************
> *****
> **
>>> An unhandled exception of type 'System.ArgumentOutOfRangeException'
>>> occurred in system.data.dll
>>>
>>> Additional information:
>>> Specified argument was out of the range of valid values.\r\nParameter
>>> name: Year, Month, and Day parameters describe an unrepresentable
> DateTime
>>
>> Can you please send me the table creation command, and the command
>> that
>> failed? It sounds to me like a bug in the time handling by the OLE DB.
>>
>> Shachar
>>
>> --
>> Shachar Shemesh
>> Lingnu Open Source Consulting ltd.
>> Have you backed up today's work? http://www.lingnu.com/backup.html
>>
>>
>>
>
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 8: explain analyze is your friend
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Sean Davis 2005-02-23 21:19:59 Emacs and postgres
Previous Message Mohsen Pahlevanzadeh 2005-02-23 21:03:05 Re: PQsetdb