EnterpriseDB: The Enterprise Postgres Company Postgres Plus Forums: The PostgreSQL Open Source Database from EnterpriseDB
  [Search] Search   [Recent Topics] Recent Topics   [Hottest Topics] Hottest Topics   [Members]  Member Listing   [Groups] Back to home page 

DataAdapter.Fill issue using stored procedure C#.NET  XML

Forum Index » Advanced Server
Author Message
Darren_F

New member

Joined: 5 Sep 2006 13:43:06
Messages: 3
Offline

It looks like a ref cursor that is returned from a stored procedure is returned as a DataReader. The strange behavior I am seeing is that if I use a DataAdapter with its SelectCommand set to execute a stored procedure that returns a ref cursor and tell it to Fill a data table then it doesn't fill the datatable with the results of the query but rather fills it with just one column called 'name' and one single row with a string of "EnterpriseDB.EDBClient.EDBDataReader".

Under other databases this fills the data table with the columns and rows of the query results of the cursor, why should this be any different?
Anonymous



Is my only options to set the data source on the datatable to the reader and call bind?
Anonymous



I meant calling Load on the data table and passing the reader which I have tried and it blows up with another problem.
farrukh

Senior member

Joined: 25 Mar 2008 02:56:43
Messages: 255
Offline

Hi Daren,

What problem are you using while using the reader?

Thanks,
farrukh

Senior member

Joined: 25 Mar 2008 02:56:43
Messages: 255
Offline

Hi Daren,

What problem are you getting while using the reader with Load?

Thanks,
Anonymous



See the topic titled:

"DataReader/DataTable bug in .NET connector"

The error is:

{"Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints."}

The issue is that the comm column in the edb sample database has some null values and for some reason the datareader/datatable is not allowing the nulls. The meta data for that columns says AllowDBNull = false for the Decimal column "comm". This is not anything that is controlled with my code. I just created a blank DataTable and told it to load using the reader that came back from the stored procedure ref cursor.
fahd.najmi

Member

Joined: 25 Mar 2008 02:56:43
Messages: 28
Offline

Dear Darren,

This issue has been addressed in one of our posts on the same forum. Please refer to the url below for more information over the issue:

http://support.enterprisedb.com/default.asp?edb-developer.1.3649.3

Hope you find it useful.

Best regards,
hu_yang

New member

Joined: 5 Feb 2012 14:25:12
Messages: 1
Offline

check this url , this may help u

http://csharp.net-informations.com/dataadapter/csharp-dataadapater-tutorial.htm

lee.
 
Forum Index » Advanced Server
Go to:   
Powered by JForum 2.1.8 © JForum Team