HighTechTalks DotNet Forums  

Oracle stored procedure - with more than one row?

Dotnet Framework (ODBC.net) microsoft.public.dotnet.framework.odbcnet


Discuss Oracle stored procedure - with more than one row? in the Dotnet Framework (ODBC.net) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Nathan
 
Posts: n/a

Default Oracle stored procedure - with more than one row? - 09-24-2003 , 08:31 AM






Hi:
I am a newbie to accessing oracle stored procedures in C#.

I have an oracle procedure that returns more than one
row.
I wanted to get the rows and store in a dataset in C#
using OleDbDataAdapter.
I know how to do that for SQL server stored procedure
using SQLDataAdapter. I believe it's quite different for
Oracle.

It would be great if some one can post an example of an
oracle stored procedure and the way to fill it in to a
dataset using OleDbDataAdapter.
Thanks in Advance.


Reply With Quote
  #2  
Old   
Sethu
 
Posts: n/a

Default Re: Oracle stored procedure - with more than one row? - 09-24-2003 , 08:38 AM






Hi Nathan


use either Oracle's .net data provider or Microsoft's Oracle dot net data
provider. i have used MS's Oracle dot net data provider......

OracleCommand cmd = null;

OracleDataAdapter adap = null;

cmd = new OracleCommand(storedProcedureName);

cmd.Connection = oracleConnection;

cmd.CommandType = CommandType.StoredProcedure;

// add parameters here

//cmd.Parameters.Add(oracleParameter);

//


adap = new OracleDataAdapter(cmd);

DataTable dt = new System.Data.DataTable("SqlSP");

if(oracleConnection.State!=ConnectionState.Open)

{

oracleConnection.Open();

}

adap.Fill(dt);

-Sethu

"Nathan" <manicksooad (AT) yahoo (DOT) com> wrote

Quote:
Hi:
I am a newbie to accessing oracle stored procedures in C#.

I have an oracle procedure that returns more than one
row.
I wanted to get the rows and store in a dataset in C#
using OleDbDataAdapter.
I know how to do that for SQL server stored procedure
using SQLDataAdapter. I believe it's quite different for
Oracle.

It would be great if some one can post an example of an
oracle stored procedure and the way to fill it in to a
dataset using OleDbDataAdapter.
Thanks in Advance.




Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.