O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

ODP.NET Developer's Guide

Book Description

A practical guide for developers working with the Oracle Data Provider for .NET and the Oracle Developer Tools for Visual Studio 2005

  • Application development with ODP.NET

  • Dealing with XML DB using ODP.NET

  • Oracle Developer Tools for Visual Studio .NET

  • Read: Chapter 3 [PDF 1 MB] | Table of Contents

  • Available to download immediately as an eBook

In Detail

The Oracle Data Provider for .NET (ODP.NET) features optimized data access to the Oracle database from a .NET environment and allows developers to take advantage of advanced Oracle database functionality, including Real Application Clusters, XML DB, and advanced security. It can be used from any .NET language, including C# and VB.NET.

This book is a practical guide that will give you the in-depth information you need to work with the Oracle 10g v10.2 database from Visual Studio .NET 2005, using the Oracle Developer Tools and ODP.NET.

After introducing ODP.NET, we move on to dealing with SQL, PL/SQL, and XML DB using ODP.NET. Next we look at application development with ODP.NET: Web Applications, Web Services, and Mobile Applications. The last chapter covers Oracle Developer Tools for Visual Studio .NET. All the code examples are in Visual Basic.NET 2005.

Table of Contents

  1. ODP.NET Developer's Guide
  2. Credits
  3. About the Authors
  4. About the Reviewer
  5. Preface
    1. What This Book Covers
    2. Conventions
    3. Reader Feedback
    4. Customer Support
      1. Downloading the Example Code for the Book
      2. Errata
      3. Questions
  6. 1. Introduction to ODP.NET
    1. Introduction to ODP.NET
    2. Why Use ODP.NET?
      1. Oracle Database Access from .NET Applications
      2. What Do We Require to Work with ODP.NET?
    3. Introduction to Oracle Database Extensions for .NET
      1. Oracle Database Extensions for .NET
        1. How does .NET Work within Oracle Database?
        2. Processing of .NET Stored Procedure with Oracle
    4. Introduction to Oracle Developer Tools for Visual Studio
    5. Summary
  7. 2. Connecting to Oracle
    1. Provider-Independent Model in ADO.NET 2.0
      1. Listing All Installed .NET Data Providers
      2. Enumerating all Oracle Data Sources Available
    2. Connecting to Oracle Databases from .NET
      1. Connecting Using .NET Data Provider Factory Classes
      2. Connecting Using .NET Data Provider for OLEDB
      3. Connecting Using .NET Data Provider for ODBC
      4. Connecting using Microsoft's .NET Data Provider for Oracle
      5. Connecting Using Oracle Data Provider for .NET (ODP.NET)
      6. Connecting with Connection Pooling
      7. Connecting with System-Level Privileges or DBA Privileges
      8. Dynamic Connecting String Using OracleConnectionStringBuilder and app.config
      9. Embedding a "tnsnames.ora" Entry-like Connection String
      10. Connecting to a Default Oracle Database
      11. Connecting Using Windows Authentication (Single Sign‑On)
    3. Summary
  8. 3. Retrieving Data from Oracle Using ODP.NET
    1. Fundamental ODP.NET Classes to Retrieve Data
    2. Retrieving Data Using OracleDataReader
      1. Retrieving a Single Row of Information
      2. Using "Using" for Simplicity
      3. Retrieving Multiple Rows on to the Grid
      4. Pulling Information Using Table Name
      5. Retrieving Typed Data
          1. Retrieving Typed Data Using Ordinals
          2. Retrieving Typed Data Using Column Names
    3. Working with Data Tables and Data Sets
      1. Retrieving Multiple Rows into a DataTable Using OracleDataAdapter
      2. Filling a DataTable Using OracleDataReader
      3. Retrieving a Single Row of Information Using OracleDataAdapter
      4. Working with DataTableReader
      5. Populating a Dataset with a Single Data Table
      6. Populating a Dataset with Multiple Data Tables
      7. Presenting Master-Detail Information Using a Dataset
    4. More About the OracleCommand Object
        1. Retrieving a Single Value from the Database
        2. Handling Nulls when Executing with ExecuteScalar
        3. Handling Nulls when Working with OracleDataReader
        4. Working with Bind Variables together with OracleParameter
        5. Working with OracleDataAdapter together with OracleCommand
    5. Techniques to Improve Performance while Retrieving Data
    6. Summary
  9. 4. Manipulating Data in Oracle Using ODP.NET
    1. Executing DML or DDL Statements Using OracleCommand
      1. Using INSERT with OracleCommand
      2. Using UPDATE with OracleCommand
      3. Using DELETE with OracleCommand
      4. Multiple Inserts Using Statement Caching
      5. Multiple Inserts Using Array Binding
      6. Creating an Oracle Table Dynamically Using ODP.NET
    2. Updating Offline Data to the Database Using OracleDataAdapter
    3. Working with OracleCommandBuilder and OracleDataAdapter
    4. Working with Transactions Using ODP.NET
    5. Handling Oracle Errors and Exceptions
      1. Displaying a Single or First Error
      2. Displaying Multiple Errors
    6. Summary
  10. 5. Programming ODP.NET with PL/SQL
    1. Working with Anonymous PL/SQL Blocks
      1. Executing Anonymous PL/SQL Blocks
      2. Passing Information to Anonymous PL/SQL Blocks
      3. Retrieving Information from Anonymous Blocks
    2. Working with PL/SQL Stored Procedures and Functions
      1. Executing a PL/SQL Stored Procedure
      2. Passing Parameter Values to a PL/SQL Stored Procedure
      3. Using an Anonymous PL/SQL Block to Execute a PL/SQL Stored Procedure
      4. Retrieving Output Parameters from a PL/SQL Stored Procedure
      5. Passing IN and Getting OUT Simultaneously
      6. Handling User-Defined Application Errors
      7. Executing a PL/SQL User-Defined Function
    3. PL/SQL Packages, Tables, and REF CURSOR
      1. Executing Routines in a PL/SQL Package
        1. Executing a Procedure in a PL/SQL Package
        2. Executing a User-Defined Function in a PL/SQL Package
      2. Passing Arrays to and Receiving Arrays from Oracle Database
        1. Sending an Array to Oracle Database
        2. Receiving an Array from Oracle Database
      3. Working with REF CURSOR Using ODP.NET
        1. Pulling from REF CURSOR Using OracleDataReader
        2. Filling a Dataset from REF CURSOR
        3. Working with Multiple Active Result Sets (MARS)
    4. Summary
  11. 6. Dealing with Large Objects (LOBs)
    1. Working with BFILEs
      1. Setting Up the Environment to Work with BFILEs
      2. Adding a New Row Containing BFILE
      3. Updating an Existing BFILE Row
      4. Retrieving BFILE Information from a Database
      5. Retrieving Properties of a BFILE
      6. Working with CLOBs
      7. Inserting Huge Text Information into Oracle Database
      8. Updating CLOB Information Using OracleClob
      9. Retrieving CLOB Information from Oracle Database
      10. Reading a Text File and Uploading as CLOB
    2. Working with BLOBs
      1. Setting Up the Environment to Work with BLOBs
      2. Uploading Images to Oracle Database Using BLOB
      3. Retrieving Images from Oracle Database Using BLOB
      4. Uploading Documents to and Retrieving Documents from Oracle Database
    3. Summary
  12. 7. XML and XML DB Development with ODP.NET
    1. A Fast Track on XML with Oracle
    2. Generating XML from Existing Rows in Tables
      1. Generate XML Using ADO.NET DataSet
      2. Generate XML Using ExecuteXMLReader
      3. Generate XML Using DBMS_XMLGEN
      4. Converting Rows to HTML Using XML and XSLT
    3. Manipulating Rows in a Table Using XML
      1. Inserting Rows into Oracle Using XML
      2. Updating Rows into Oracle Using XML
    4. Working with Native XML in Oracle Database
      1. Inserting XML Data into XMLType Using Traditional INSERT
      2. Updating XML Data in XMLType Using Traditional UPDATE
      3. Inserting XML Data Using OracleXmlType
      4. Retrieving and Updating XML Data Using OracleXmlType
      5. Extracting Individual Node Information of an XMLType Value
    5. Summary
  13. 8. Application Development Using ODP.NET
    1. Notifying Applications of Database Changes
      1. Catching Notifications
        1. Catching Multiple Notifications
      2. Identifying Rows Modified During Notifications
    2. Developing Long-Running Applications
      1. The Devil of Applications: "Not Responding"
      2. Asynchronous Task with Multi-Threading
    3. Developing Web Applications Using ASP.NET and ODP.NET
      1. Web Development Using Smart Data Binding
        1. Populating an ASP.NET DropDownList Control
        2. Linking an ASP.NET GridView Control with a DropDownList Control
        3. Add, Update, or Delete a Row Using GridView and FormView
      2. Working with Web Controls Manually
    4. Developing Web Reports Using ASP.NET
      1. Creating a Strongly-Typed Dataset Using Designer
      2. Designing and Binding a Report to the Dataset
      3. Grouping and Displaying Sub-Totals
      4. Embedding Charts (Graphs) in Reports
    5. Object-Oriented Development Using ASP.NET and ODP.NET
      1. Developing a Simple Oracle Database Helper Class
      2. Developing a Simple Business Logic Class
      3. Working with ObjectDataSource in an ASP.NET 2.0 Web Form
    6. Developing Web Services Using ODP.NET
      1. Creating the .NET XML Web Service
      2. Consuming the Web Service from ASP.NET
    7. Developing Smart Device Applications
      1. Introducing Microsoft Windows Mobile
      2. Consuming a Web Service from Pocket PC
    8. Summary
  14. 9. Introduction to Oracle Developer Tools for Visual Studio 2005
    1. Features of Oracle Developer Tools
      1. Connecting to Oracle from Visual Studio Using Oracle Explorer
      2. Retrieving Oracle Information from Visual Studio Using ODT
      3. Working with Oracle Database Objects from Visual Studio Using ODT
        1. Dealing with Tables, Views, and Sequences Using ODT
        2. Creating Stored Procedures Using ODT
    2. Debugging PL/SQL Stored Procedures from Visual Studio
    3. .NET CLR Stored Procedures in Oracle
    4. Taking Advantage of Automatic .NET Code Generation
    5. Summary