I am passing an ADODB.Recordset (rs) into a .Net C# dll. I need to fill a
dataset using Oracle.DataAccess.Client.DataAdaptor.

OracleDataAdapter da = new OracleDataAdapter();
DataSet ds = new DataSet();
DataTable dt = new DataTable();
da.Fill(dt, rs);

This does not work. I need to use:
da.Fill(dt, ref cursor);

How do I convert the recordset (rs) to a ref cursor?

Thanks....
--
Robert Hill
Senior Programmer/Analyst
Wake Forest Univ Baptist Med Ctr

Re: Recordsets and Ref Cursors by Paul

Paul
Tue Dec 28 16:38:49 CST 2004

On Tue, 28 Dec 2004 12:59:03 -0800, "Marathoner"
<Marathoner@discussions.microsoft.com> wrote:

¤ I am passing an ADODB.Recordset (rs) into a .Net C# dll. I need to fill a
¤ dataset using Oracle.DataAccess.Client.DataAdaptor.
¤
¤ OracleDataAdapter da = new OracleDataAdapter();
¤ DataSet ds = new DataSet();
¤ DataTable dt = new DataTable();
¤ da.Fill(dt, rs);
¤
¤ This does not work. I need to use:
¤ da.Fill(dt, ref cursor);
¤
¤ How do I convert the recordset (rs) to a ref cursor?

Could you expand on this a bit? Why do you need a ref cursor?

In addition, can we assume you're passing the ADODB Recordset to the C# DLL by
value and not by ref?


Paul ~~~ pclement@ameritech.net
Microsoft MVP (Visual Basic)

Re: Recordsets and Ref Cursors by Marathoner

Marathoner
Tue Dec 28 21:09:03 CST 2004

I am sorry for my ignorance but this is new to me. I assume I need a ref
cursor since the Fill method of the Oracle.DataAccess.Client.DataAdaptor will
not take a recordset as a parameter but will take a ref cursor as a
parameter. I will admit to struggling with this issue of trying to make a
VB6 app work with our .Net code. Yes, I am passing the recordset by value
and not by ref. The dataset will be passed into an Oracle stored proc so I
thought it best to use the Oracle.DataAccess.Client.DataAdaptor. The
OleDbDataAdaptor's Fill method does take a recordset as a parameter but I do
not know if I can pass that dataset into the Oracle stored proc.

THANKS FOR YOUR REPLY....


"Paul Clement" wrote:

> On Tue, 28 Dec 2004 12:59:03 -0800, "Marathoner"
> <Marathoner@discussions.microsoft.com> wrote:
>
> ¤ I am passing an ADODB.Recordset (rs) into a .Net C# dll. I need to fill a
> ¤ dataset using Oracle.DataAccess.Client.DataAdaptor.
> ¤
> ¤ OracleDataAdapter da = new OracleDataAdapter();
> ¤ DataSet ds = new DataSet();
> ¤ DataTable dt = new DataTable();
> ¤ da.Fill(dt, rs);
> ¤
> ¤ This does not work. I need to use:
> ¤ da.Fill(dt, ref cursor);
> ¤
> ¤ How do I convert the recordset (rs) to a ref cursor?
>
> Could you expand on this a bit? Why do you need a ref cursor?
>
> In addition, can we assume you're passing the ADODB Recordset to the C# DLL by
> value and not by ref?
>
>
> Paul ~~~ pclement@ameritech.net
> Microsoft MVP (Visual Basic)
>

Re: Recordsets and Ref Cursors by Paul

Paul
Wed Dec 29 09:15:27 CST 2004

On Tue, 28 Dec 2004 19:09:03 -0800, "Marathoner" <Marathoner@discussions.microsoft.com> wrote:

¤ I am sorry for my ignorance but this is new to me. I assume I need a ref
¤ cursor since the Fill method of the Oracle.DataAccess.Client.DataAdaptor will
¤ not take a recordset as a parameter but will take a ref cursor as a
¤ parameter. I will admit to struggling with this issue of trying to make a
¤ VB6 app work with our .Net code. Yes, I am passing the recordset by value
¤ and not by ref. The dataset will be passed into an Oracle stored proc so I
¤ thought it best to use the Oracle.DataAccess.Client.DataAdaptor. The
¤ OleDbDataAdaptor's Fill method does take a recordset as a parameter but I do
¤ not know if I can pass that dataset into the Oracle stored proc.
¤

If you use the native ADO.NET you won't be able to populate an ADODB Recordset directly. There are
two alternatives:

1) Use ADO via interop (with the Command object) and connect via ODBC or OLEDB. This code would
likely be similar to what you have in your VB 6.0 application.

2) Populate a DataSet using the stored procedure and then move the data from the DataSet to the
Recordset. The following MS KB articles may help:

How To Retrieve Multiple Ref_cursors from an Oracle Stored Procedure by Using the .NET Managed
Provider For Oracle
http://support.microsoft.com/default.aspx?scid=kb;en-us;321715

How To Convert an ADO.NET DataSet to ADO Recordset in Visual Basic .NET
http://support.microsoft.com/default.aspx?scid=kb;en-us;316337


Paul ~~~ pclement@ameritech.net
Microsoft MVP (Visual Basic)

Re: Recordsets and Ref Cursors by Cor

Cor
Wed Dec 29 09:30:35 CST 2004

Paul,

I dont know all what is in this message thread, however when I saw your
message I had to think on this, it is in my opinon very hidden on MSDN so I
don't know if you know this one and maybe is it helpfull.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdataoledboledbdataadapterclassfilltopic.asp

Cor



Re: Recordsets and Ref Cursors by Paul

Paul
Thu Dec 30 11:55:55 CST 2004

On Wed, 29 Dec 2004 16:30:35 +0100, "Cor Ligthert" <notmyfirstname@planet.nl> wrote:

¤ Paul,
¤
¤ I dont know all what is in this message thread, however when I saw your
¤ message I had to think on this, it is in my opinon very hidden on MSDN so I
¤ don't know if you know this one and maybe is it helpfull.
¤
¤ http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdataoledboledbdataadapterclassfilltopic.asp

Cor,

Does this overloaded Fill method copy the contents from a DataTable to an ADO Recordset?


Paul ~~~ pclement@ameritech.net
Microsoft MVP (Visual Basic)

Re: Recordsets and Ref Cursors by Cor

Cor
Thu Dec 30 12:36:17 CST 2004

Paul,

No in the opposite way, I only wanted to make you attent on it, as I know it
is very hidden and you are often busy with this. (As I wrote I don't know if
you do know this already)

Nothing more.

Cor



Re: Recordsets and Ref Cursors by Paul

Paul
Mon Jan 03 10:03:19 CST 2005

On Thu, 30 Dec 2004 19:36:17 +0100, "Cor Ligthert" <notmyfirstname@planet.nl> wrote:

¤ Paul,
¤
¤ No in the opposite way, I only wanted to make you attent on it, as I know it
¤ is very hidden and you are often busy with this. (As I wrote I don't know if
¤ you do know this already)
¤
¤ Nothing more.

Yes I know about it but he needs to fill the Recordset from the DataSet and not vice versa. ;-)


Paul ~~~ pclement@ameritech.net
Microsoft MVP (Visual Basic)

Re: Recordsets and Ref Cursors by Jai

Jai
Wed Feb 02 00:35:05 CST 2005

Hi guys,

I have problem with respect to ref cursor.
My DB ask me to pass data (about 30 fileds) to oracle stored procedure by
ref cursor. Can you help me in this regards..

Jaiganesh