!C99Shell v. 1.0 pre-release build #13!

Software: Apache. PHP/5.5.15 

uname -a: Windows NT SVR-DMZ 6.1 build 7600 (Windows Server 2008 R2 Enterprise Edition) i586 

SYSTEM 

Safe-mode: OFF (not secure)

E:\oracle\product\10.2.0\client_2\oledb\samples\DataSet\DSwithRefCur\doc\   drwxrwxrwx
Free 4.94 GB of 239.26 GB (2.06%)
Detected drives: [ a ] [ c ] [ d ] [ e ] [ f ]
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     Readme.html (14.79 KB)      -rw-rw-rw-
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
OLEDB - Populate DataSet With Multiple Ref Cursors - Readme  

View Products- Populate DataSet With Multiple Ref Cursors Through Oracle Provider for OLEDB

Table of Contents 

Overview of the Sample Application 

Back To Top

This .NET sample application demonstrates how to populate a DataSet with data from multiple Ref Cursors from PL/SQL stored procedure through Oracle Provider for OLE DB. The Oracle9i Release 2 OLE DB provider introduces full support for .NET via the Microsoft OLE DB .NET data provider. With OLE DB .NET, applications can access the Oracle database from any .NET programming language.

To return  Ref Cursor from a PL/SQL stored procedure, a variable of Ref Cursor type is used as OUT parameter from Stored Procedure. This parameter is not required to be bound to the Stored Procedure call in the application. Oracle Provider for OLE DB automatically binds the Ref Cursor variables and returns the records appropriately. To enable the Data Provider to bind Ref Cursor variables automatically, the attribute 'PLSQRSet' should be set to true while getting the connection from database.

The PL/SQL Stored Procedure returning multiple Ref Cursors is called using OleDbCommand Object. The OleDbDataAdapter executes this command object. OleDbDataAdapter fills the DataSet with Ref Cursors returned from the Stored Procedure. The No. of Data Tables created in the DataSet is equal to the No. of Ref Cursors returned from the Stored Procedure. The Data Tables are named as 'TableN' where N stands for an integer starting from 0. These Data Tables can be bound to different Data Grids. 

When this sample application is run, two Data Grids are displayed. One Data Grid populated with records for products with 'Orderable' product status and other Data Grid populated with records for products with 'Under Development' product status. A PL/SQL Stored Procedure 'GetProductsInfo' is called that returns two Ref cursors as 'OUT' parameters. The DataSet is filled with data in Ref Cursor. The two Data Tables created are 'Products' and 'Products1'. The Data Grids are bound to these Data Tables. Hence demonstrating how to  populate DataSet with multiple ref Cursors.

User Notes with Screen Shots

Back To Top
When this sample application is run, a list of products with 'Orderable' status is shown in the first Data Grid and a list of 
products with Under Development' status in the second Data Grid is displayed as shown in figure 1.1,  On clicking the 'Close' button, 
the application gets closed. 

                   Figure 1.1 Screen Shot for Populate Data Set with Multiple Ref Cursors Sample

Required Software 

Back To Top
1. Visual C# installed with MS Development Environment 7.0 version (MS Visual Studio .Net)  including MS .NET Framework 1.0 version

2. Oracle8i Database or later running SQL*Net TCP/IP listener (can be downloaded here )

3. Oracle Provider for OLE DB (can be downloaded here)

Extracting the Sample

Back To Top
Unzip DSwithRefCur.zip using Winzip or command utility to your convenient directory. Extraction of the zip file results 
in the creation of 'DSwithRefCur' directory.  Refer Description of Sample Files section for more details. 
 

Database Setup 

Back To Top
Connect to your database as any user and run the scripts DSwithRefCur\setup\DatabaseSetup.sql and  DSRefCur\setup\StoredProcedure.sql at the SQL prompt
SQL> @<your directory structure>\DSwithRefCur\setup\DatabaseSetup.sql
SQL> @<your directory structure>\DSwithRefCur\setup\StoredProcedure.sql

DatabaseSetup.sql file creates a user "OraNet" with password "OraNet". All the database objects required by the 
application are created and populated with sample data. StoredProcedure.sql file creates a package 'oraoledb' that returns multiple Ref Cursors. 

Following is the list of database objects that get created by running DatabaseSetup.sql file. 
Object Name Description
Products Table that store information about products.
Printmedia Table that stores information about the advertisement related to products.
Prodid_seq Sequence for auto generating Product IDs.
Adid_seq Sequence for auto generating Advertisement ID.
PopulateProduct_ID Trigger for populating value of Product ID field from Adid_seq sequence, on insertion. 
Populate_AdID Trigger for populating  Ad_ID column of 'PrintMedia'  table on insertion.
OraOleDb Database Package containing 'getProductsInfo' stored procedure.

Preparing and Running the Sample

Back To Top
1. Ensure that the Database setup has been completed. 

2. Open DSwithRefCur.sln using Visual Studio .Net from <your-directory-structure>\DSwithRefCur\src folder. 

3. Edit ConnectionParams.cs file to change the database connection parameters i.e. TNSName for  database 
you want to use . Save this file. 

4. Ensure that the following .Net Component References have been added to DSwithRefCur project: 
           System, 
           System.Data, 
           System.Drawing, 
           System.Windows.Forms, 
           System.XML. 

To add the above .Net Components 
     a)Go to Menu ->View-> Solution Explorer. 
     b)Right click on DSwithRefCur project, choose 'Add Reference'. 
     c)Choose the above .Net Components from the list displayed. 
     d)Click 'Select', then OK. 
     e) The chosen .Net component gets added to the project. 

5. Build and run the sample. 

Description of Sample Files 

Back To Top
Directory File Name Description
DSwithRefCur\doc Readme.html This file
blaf.css This is a cascading stylesheet applied to Readme.html
DSwithRefCur\doc\images This folder contains images used in the Readme.html file
DSwithRefCur\src\ DSwithRefCur.sln Microsoft Visual Studio Solution
  DSwithRefCur.suo Solution User option (this file gets automatically generated when a Visual Studio Solution is created)
DSwithRefCur\src\ ConnectionParams.cs This C# file contains parameters for database connection
ViewProducts.cs This C# file contains source code for UI for this sample application and its functionality
DSwithRefCur.csproj C# project file
DSwithRefCur.csproj.user Visual Studio Project User Options (this file gets automatically generated when a Visual Studio Project is created).
ViewProducts.resx .Net XML Resource Template (this file gets automatically generated when a Visual Studio Project is created)
DSwithRefCur\setup DatabaseSetup.sql This is a SQL script file that creates tables and populate them with initial data.
StoredProcedure.sql This is a SQL file that creates 'OraOleDb' Package


Please enter your comments about this sample in the OTN Sample Code Discussion Forum.


:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ ok ]

:: Make Dir ::
 
[ ok ]
:: Make File ::
 
[ ok ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 1.0 pre-release build #13 powered by Captain Crunch Security Team | http://ccteam.ru | Generation time: 0.0312 ]--