ADO.NET ExecuteReader returns no rows

From: roman(dot)motyka(at)gmail(dot)com
To: pgsql-general(at)postgresql(dot)org
Subject: ADO.NET ExecuteReader returns no rows
Date: 2006-03-24 14:38:20
Message-ID: 1143211100.664677.233540@i39g2000cwa.googlegroups.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello,

Someitmes ExectueReader doesn't return rows, if I repeat the method it
does!!

I've got code like that:
using (NpgsqlDataReader readFrames =
command.ExecuteReader())
{
if (!readFrames.HasRows)
{
System.Diagnostics.Debugger.Break();
}

while (readFrames.Read())
{
currentMaxDate =
(DateTime)readFrames["idvideodate"];
mediaData.Add((byte[])readFrames["mediabinary"]);
}

readFrames.Close();
}

That part of code executes multiple times and always, soon or later
I've got reader without rows.. When I execute that statement again:
the same parameters - ExecuteReader() returns rows (as it should).

The problem occurs in both versions: 0.71 and in 1.0 beta 2.
I've also tried commercial driver from Core Lab.. with the same
result.
PostgresSQL version 8.1.2.

The field idvideodate is Timestamp and mediabinary is bytea.

Probably it's a problem not with ado.net driver, but with
PostgressSQL but how to cope with that?

Roman.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message joseph 2006-03-24 14:43:45 Re: another seemingly simple encoding question
Previous Message Jim C. Nasby 2006-03-24 14:05:52 Re: URGENT! could not access status of transaction