Chapter 28. Creating a Custom ADO.NET Data Provider


IN BRIEF

As you saw in the previous chapter, using the ADO.NET data providers gives you a consistent user experience, whether you're connecting to some OLE DB data source, SQL, Oracle, or even an ODBC data source. The goal of the consistent data provider model is that programmers need to learn to use only one set of interfaces, regardless of which database they are accessing.

You've seen it from the consumer point of view, and this chapter will show you ADO.NET data providers from the perspective of the data provider. In this chapter, you will see a lot of code for creating your own custom data provider. In addition to the code for a custom provider, you will also see the details on all the interfaces required to implement a provider, as well as guidelines for when you should and should not implement your own custom provider.

WHAT YOU NEED

REQUIRED SOFTWARE

.NET Framework SDK v1.1

VSVisual Studio .NET 2003 w/with C# Installedinstalled

RECOMMENDED HARDWARE

PC that meets .NET SDK minimum requirements

SKILLS REQUIRED

C# and .NET Familiarityfamiliarity

Familiarity with web services (see Chapters 18 and 32)


CREATING A CUSTOM ADO.NET DATA PROVIDER AT A GLANCE

Custom Data Providers

555

  
 

When to Create a Data Provider

555

Sample Data Provider Scenario

556

 

Steps for Implementing a Custom Data Provider

556

Overview of the Remote Data Provider

557

Implementing IDataParameter and IDataParameterCollection

558

  
 

The IDataParameter Interface

558

The RDPParameter Class

559

 

The IDataParameterCollection Interface

559

The RDPParameterCollection Class

563

Implementing a Custom Connection

565

  
 

The IDbConnection Interface

566

The RDPConnection Class

566

Implementing a Custom Command

569

  
 

The IDbCommand Interface

569

The RDPCommand Class

570

Implementing a Custom DataReader

575

  
 

The IDataReader Interface

575

The RDPDataReader Class

576

Implementing a Custom DataAdapter DataAdapter

582

  
 

The IDbDataAdapter Interface

582

The RDPDataAdapter Class

582

Summary

587

  




    Visual C#. NET 2003 Unleashed
    Visual C#. NET 2003 Unleashed
    ISBN: 672326760
    EAN: N/A
    Year: 2003
    Pages: 316

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net