ASP.NET
  Home arrow ASP.NET arrow Oracle Database Interaction Using ODP.NET ...
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Silverlight  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
ASP Web Hosting  
ASP.NET Web Hosting 
Windows Web Hosting
 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
ASP.NET

Oracle Database Interaction Using ODP.NET and ASP.NET: All Ways to Manipulate Data
By: Jagadish Chaterjee
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 5
    2005-10-13

    Table of Contents:
  • Oracle Database Interaction Using ODP.NET and ASP.NET: All Ways to Manipulate Data
  • What are all the possible ways to work with those classes?
  • Using a single DML command at a time
  • Using multiple DML commands
  • Multiple DML commands with parameters: Method 1

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Oracle Database Interaction Using ODP.NET and ASP.NET: All Ways to Manipulate Data


    (Page 1 of 5 )

    This article (part four of this series) mainly concentrates on manipulating data in an Oracle database with ODP.NET using ASP.NET in several possible ways.
    A downloadable file for this article is available here.

    The sample downloadable solution (zip) is entirely developed using Visual Studio.NET 2003 Enterprise Architect on Windows Server 2003 Standard Edition together with Oracle 10g (version 10.2).  But, I am confident that it would work with other versions of Windows (which support .NET 1.1) as well.

    What classes are generally used?

    My previous articles mainly concentrated on connecting to Oracle database and retrieving information in several possible ways.  In this article I mainly concentrate on manipulating information in an Oracle 10g (10.2) database using ODP.NET.

    By now, you must have known that you need to work with Oracle.DataAccess.Client namespace to use ODP.NET.  The same namespace has several classes, collections, enumerated types, and so on to work conveniently with both SQL and PL/SQL of Oracle 10g product.  It even boasts much tighter integration with .NET, when compared to Microsoft’s .NET provider for Oracle (System.data.OracleClient namespace).

    The most generic classes in ODP.NET for manipulating information in an Oracle database would be the following:

    • OracleConnection
    • OracleCommand
    • OracleDataAdapter
    • OracleParameter
    • OracleParameterCollection
    • OracleCommandBuilder

    Of course, any .NET data provider would provide similar interfaces to a database (conforming to the standards of .NET data provider specification). The “OracleConnection” class is used to make a connection (for both dedicated or shared connections) to an Oracle database.  Without the help of the “OracleConnection” class, all the rest would do nothing (as we will not be able to connect at all). 

    The “OracleCommand” class is used to issue a command (either SELECT or DML or to execute a stored procedure or any of a number of other options) to an Oracle database for some DML operation.  If we pass a DML statement (or execute a stored procedure which does some DML operation) to an instance of the “OracleCommand” class, our application may receive the result of that DML statement (in the form of rows, or a single value, or bytes, or other possible forms). 

    The “OracleDataAdapter” is generally used in connectionless scenarios.  It connects (through “OracleConnection”) to the database, passes a command (of the type “OracleCommand”), fetches the information and files it into either “datatable” or “dataset” and finally breaks the “OracleConnection” itself.  After making all modifications to the “datatable” or “dataset” (which are offline), we update them again using the same “OracleDataAdapter”.  We can provide our own DML commands for “OracleDataAdapter”, when it is trying to update the database.  “OracleCommandBuilder” is generally used with “OracleDataAdapter” to automatically generate DML commands for a single table SELECT command issued.

    “OracleParameter” and “OracleParameterCollection” are generally used to work with parameterized commands (or parameterised stored procedures, and so on).  The next section gives further depth for some of the above classes in detail, so that you can select your own flexible approach based on the considerations of performance, ease, readability, re-usability and so on.

    More ASP.NET Articles
    More By Jagadish Chaterjee


       · hey guys, this is my following article in ODP.NET series....enjoy
     

    ASP.NET ARTICLES

    - Adding Content to a Static ASP.NET Website
    - Building a Static ASP.NET Website in a Basic...
    - Develop Your First ASP.NET Website with Visu...
    - Run ASP.NET in Windows XP Home with Cassini ...
    - How to Test a Web Application
    - How to Add Code and Validation Controls to a...
    - Working in Source and Split Views to Build a...
    - How to Build a Web Form for a One-Page Web A...
    - How to Develop a One-Page Web Application
    - An ASP.NET Web Application in Action
    - Developing ASP.NET Web Applications
    - An Introduction to ASP.NET Web Programming
    - Introduction to the ADO.NET Entity Framework...
    - Completing an In-Text Advertising System und...
    - Programming an In-Text Advertising System un...





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 4 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek