Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > ADO.NET
|
ADO.NET For discussion about ADO.NET.  Topics such as question regarding the System.Data namespace are appropriate.  Questions specific to a particular application should be posted in a forum specific to the application .
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ADO.NET 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 October 29th, 2004, 01:23 PM
Authorized User
 
Join Date: Jan 2004
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default Get Data from Oracle cursors

I have written a stored procedure with 2 cursors of out direction. I want to retreive the 2 cursor record sets into one dataset. I am able to create dataset with one cursor. Can you pls help me how o get from 2 cursors and i want to store the data into a single dataset with 2 tables.

 
Old November 10th, 2004, 11:55 AM
Friend of Wrox
 
Join Date: Sep 2004
Posts: 140
Thanks: 0
Thanked 0 Times in 0 Posts
Default

are'nt u using ref cursors

 
Old January 27th, 2009, 11:38 AM
Registered User
Points: 8, Level: 1
Points: 8, Level: 1 Points: 8, Level: 1 Points: 8, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2009
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default


create a data adapter based on your datasource.
here I am using oracle

Code:
OracleCommand cmd = new OracleCommand();
OracleDataAdapter dbAdapter = new OracleDataAdapter();
dbAdapter.cmd = conn;
//assign the stored procedure to cmd
//assign the command type to be storedprocedure, then
Code:
DataSet dataSet = newDataSet();
DataTable dataTable = newDataTable();
dataTable.BeginLoadData();
dbAdapter.Fill(dataTable);
dataTable.EndLoadData();
dataSet.EnforceConstraints = false;
dataSet.Tables.Add(dataTable);


this should have both tables written into one dataset.

to check you can write the tables to a xml schema and see if you have the tables:

dataSet.WriteXmlSchema("path\\tables.xsd");

Hope this helps





Similar Threads
Thread Thread Starter Forum Replies Last Post
How to Read Oracle Data without Oracle being insta badrinarayanang Oracle 1 October 6th, 2005 06:34 AM
MYSQL and Cursors paulkholt MySQL 1 September 8th, 2004 08:25 AM
Custom Cursors gp_mk Classic ASP Basics 0 May 29th, 2004 03:37 AM





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