Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
|
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 18th, 2006, 12:36 PM
Registered User
 
Join Date: Nov 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default .Net reader with Oracle table function return type

Hi,
I have a problem to solve: with .Net i shoud call an Oracle function that return a table type. I tested my packege directly and it's right: it returns what i want. The c# method returns instead error.

The package is like that.
Package:
CREATE OR REPLACE PACKAGE myPck AS
TYPE myRecord IS RECORD
(
IDPR NUMBER (12),
DESPR VARCHAR2 (40)
-- altri campi ...
);

TYPE myTable IS TABLE OF myRecord
INDEX BY BINARY_INTEGER;

FUNCTION Elabora(p_utente IN VARCHAR2)
RETURN myTable;

END myPck;

My class have a method like this
C# da applicativo .Net:
public List<Elenco> CallProc1(string idPr)
{
using (OracleConnection cn = new OracleConnection(this.ConnectionString))
{
List<Elenco> elenco = new List<Elenco>();
OracleCommand cmd = cn.CreateCommand();
cmd.CommandText = "myPck.Elabora";
cmd.CommandType = CommandType.StoredProcedure;

 cmd.Parameters.Add(new OracleParameter("IdPr", OracleType.VarChar)).Direction = ParameterDirection.Input;
cmd.Parameters[0].Value = idPr;

/* do something here ??? */

OracleDataReader reader;

cn.Open();

reader = command.ExecuteReader();
while (reader.Read())
{

/* Are right ??? */
Elenco ele = new Elenco();
ele.idPr = (int)reader["IDPR"];
ele.DesPr = reader["DESPR"].ToString();
elenco.Add(ele);
/**/

}
reader.Close();

}

return elenco;

}






Similar Threads
Thread Thread Starter Forum Replies Last Post
.Net reader with Oracle table function return type l.wolf Oracle ASP 1 July 24th, 2007 06:45 AM
Calling Oracle function from Vb.net class monuindia2002 ADO.NET 1 August 4th, 2006 05:00 AM
Return TYPE TABLE to VB from Oracle muttleychess Pro VB Databases 3 August 2nd, 2006 03:28 PM
oracle data reader silvia C# 10 February 2nd, 2006 07:30 AM
could i join function(return table) with a table alyeng2000 SQL Server 2000 6 September 30th, 2004 07:23 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.