PgSqlDataAdapter can't retrieve more than 1 table

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for PostgreSQL
Post Reply
peevee12
Posts: 2
Joined: Tue 28 Dec 2010 06:33

PgSqlDataAdapter can't retrieve more than 1 table

Post by peevee12 » Tue 28 Dec 2010 07:32

I've created a function in PostgreSQL that should return 2 set of tables but when I retrieved this results using PgSqlDataAdapter and populate it into a PgSqlDataSet it only returns 1 table..Here are my codes..I'll appreciate any help, I'm figuring out this problem for almost 1 week.

Code: Select all

CREATE OR REPLACE FUNCTION refcursorfunc1()
  RETURNS SETOF REFCURSOR AS
$$ 
DECLARE 
v_refcursor refcursor;
v_refcursor2 refcursor; 
BEGIN 

OPEN v_refcursor FOR
SELECT * FROM customer;
RETURN NEXT v_refcursor;


OPEN v_refcursor2 FOR 
SELECT * FROM orders; 
RETURN NEXT v_refcursor2;

RETURN;
END; 
$$  LANGUAGE plpgsql;
And I retrieve those data in C# using these codes:

Code: Select all

 PgSqlConnection myConnection = new PgSqlConnection();
 PgSqlConnectionStringBuilder pgCSB = new PgSqlConnectionStringBuilder();
            pgCSB.Host = "localhost";
            pgCSB.Port = 5432;
            pgCSB.UserId = "postgres";
            pgCSB.Password = "somepassword";
            pgCSB.MaxPoolSize = 150;
            pgCSB.ConnectionTimeout = 30;
            pgCSB.Database = "somedatabase";


 PgSqlCommand cmd = new PgSqlCommand("refcursorfunc1");
 cmd.Connection = myConnection;
 cmd.CommandType = CommandType.StoredProcedure;
 cmd.ParameterCheck = true;
 myConnection.Open();
 PgSqlTransaction t = myConnection.BeginTransaction();
 PgSqlDataAdapter adpt = new PgSqlDataAdapter(cmd);
 PgSqlDataSet ds = new PgSqlDataSet();
 adpt.Fill(ds);
 t.Commit();
 
But by examining the variable ds which is a PgSqlDataSet Type, it only contains the table customer which is the first executed statement in my refcursorfunc1() function.

Why did the adpt variable which is a PgSqlDataAdapter Type behaved like this? The adpt variable populates the ds variable with only 1 TABLE. Am I missing something here?Im solving this problem for almost 1 week.Please help

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Tue 28 Dec 2010 12:51

We have reproduced the mentioned behaviour. We will investigate it and notify you about the result as soon as possible.

peevee12
Posts: 2
Joined: Tue 28 Dec 2010 06:33

Post by peevee12 » Tue 28 Dec 2010 23:51

thanks shalex, Im hoping that this problem will be solved as soon as possible.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Wed 29 Dec 2010 16:11

We have fixed the problem. The fix will be included in the next build of dotConnect for PostgreSQL. We plan to release it in 2 weeks. I will post here when it is available for download.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Wed 12 Jan 2011 17:46

New build of dotConnect for PostgreSQL 5.00.86 is available for download now!
It can be downloaded from http://www.devart.com/dotconnect/postgr ... nload.html (trial version) or from Registered Users' Area (for users with valid subscription only): http://secure.devart.com/ .
For more information, please refer to http://www.devart.com/forums/viewtopic.php?t=19970 .

Post Reply