ASP.NET
  Home arrow ASP.NET arrow Database Independent Development using ASP...
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  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Dedicated Servers 
Actuate Whitepapers 
Moblin 
Windows Web Hosting
 
IBM® developerWorks 
Sun Developer Network 
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

Database Independent Development using ASP.NET 2.0
By: Jagadish Chaterjee
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 20
    2007-02-14

    Table of Contents:
  • Database Independent Development using ASP.NET 2.0
  • Developing a common class which works with Factories: source code
  • Developing a common class which works with Factories: explanation
  • Developing a simple data access class to work with the factory: skeleton
  • Developing a simple data access class to work with the factory: methods
  • Developing a simple data access class to work with the factory: methods extended

  • 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

    Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here

    Database Independent Development using ASP.NET 2.0


    (Page 1 of 6 )

    This article shows you how to develop database independent applications using ASP.NET 2.0. I shall also show you how to develop a simple database independent data access layer using ADO.NET 2.0.
    A downloadable file for this article is available here.

    The entire solution (source code) for this article is available as a free download (in the form of a zip). All the applications in this series have been developed using Microsoft Visual Studio 2005 Professional Edition on Microsoft Windows Server 2003 Standard Edition together with Microsoft SQL Server 2005 Express Edition and Oracle 10g Express editions as the database. I didn't really test any of the code in any other tools/IDEs/servers/editions/versions. If you have any problems, please feel free to post in the discussion area.

    Provider independent model in ADO.NET 2.0

    ADO.NET internally works with .NET data providers (or .NET data bridge providers) to connect to and access data from different kinds of data sources (including databases). The same data provider model existing in ADO.NET 1.1 is further enhanced in ADO.NET 2.0 (with a few factory classes) to leverage the flexibility of developing database independent applications.

    The purpose of a factory class is to provide an interface for creating families of related objects, with or without specifying their concrete (method implementation) classes. If the factory class is created without one or more implementations of methods, we call it an abstract factory class.

    The provider-independent programming model in ADO.NET 2.0 revolves around the classes in the System.Data.Common namespace. There are mainly two new factory classes that implement the provider-independent model (with the same namespace):

    • DbProviderFactories
    • DbProviderFactory

    The DbProviderFactories class is mainly used to enumerate all .NET data providers installed on your machine. Using the same class, we can also create instances related to a specific provider (to access databases specific to that provider). These instances are nothing but the objects of the DbProviderFactory class.

    Using the DbProviderFactory class, we can create Connection, Command, DataAdapter and other objects. These objects will be provider specific (like SQLConnection, OracleConnection, ODBCConnection etc.), but will be returned into a "commons" like parent classes called DBConnection, DBCommand, DBDataAdapter etc. which are available as part of System.Data.Common namespace.

    The upcoming sections will show you how to develop a database independent data access layer using ADO.NET 2.0

    More ASP.NET Articles
    More By Jagadish Chaterjee


       · Hello guys! This is new series on database independent development using ASP.NET...
     

    ASP.NET ARTICLES

    - Enhancing PHP Via the ASP.NET AJAX Framework...
    - Enhancing PHP Programming with the ASP.NET A...
    - Classes and ASP.NET AJAX
    - Using ASP.NET AJAX
    - Building a Simple Storefront with LINQ
    - Developing a Dice Game Using ASP.NET Futures...
    - Completing an ASP.NET AJAX Server-Centric Ba...
    - Information Management for an ASP.NET AJAX S...
    - Comment and Order Management for an ASP.NET ...
    - Back-end Management Tasks for an ASP.NET AJA...
    - User Information Management for an ASP.NET A...
    - Adding Comments and Search to an ASP.NET AJA...
    - Order-Related Modules for an ASP.NET AJAX Se...
    - User and Role Management for an ASP.NET AJAX...
    - Programming an ASP.NET AJAX Server-Centric B...





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway