Chapter 13: Developing a Custom Data Provider


ADO.NET allows developers as much flexibility in creating custom data providers as Microsoft had developing the SqlClient and OleDb data providers. In other words, you can create data providers for virtually any source of data you can think of, from file formats to Web services.

Think about some of the possibilities this presents. If you needed to create a database application that works on top of a number of different databases such as Microsoft SQL Server and IBM DB2, you could build a Web service that does the actual database access while your custom data provider provides the front end. Figure 13-1 shows such an application would work.

click to expand
Figure 13-1: A Web-service-based data provider that accesses a Relational Database Management System (RDBMS)

Using an architecture like the one shown in Figure 13-1, you can have focused teams develop compatibility to the Web service you've created for data access. Your data provider only needs to know how to access the Web service, and you can build your application using the same Application Programming Interface (API) as you would for direct database calls.

The advantage of building a system like this is obvious—you can start building your application on top of the ADO.NET interfaces while the data provider, Web service architecture, and individual database compatibility gets worked out. This is more than a little helpful if you're working on a large project requiring cross-database compatibility.

This example highlights why the ability to write a custom data provider is truly beneficial; it's a way to provide standard access to a nonstandard source of data. In other words, this provides a way to normalize the way you work with data regardless of the source.

In this chapter you'll build a data provider that allows access to data in pipe-delimited format, and you'll provide a standard .NET API by implementing the Microsoft interfaces to create a custom data provider. The pipe-delimited format is common, especially to Unix systems, as a way to move data between systems. Many large Enterprise Resource Planning (ERP) systems support the ability to export data in this format. Another popular format you could build support for is the Comma Separated Values (CSV) format, which is more popular on Windows systems. This chapter begins with an overview of the data provider interfaces.

Applied ADO. NET(c) Building Data-Driven Solutions
Applied ADO.NET: Building Data-Driven Solutions
ISBN: 1590590732
EAN: 2147483647
Year: 2006
Pages: 214 © 2008-2017.
If you may any questions please contact us: