Chapter 15 Practical ADO.NET

Team Fly 

Page 391

Chapter 15
Practical ADO.NET

ADO.NET, MICROSOFT'S LATEST DATA access technology, is the evolution of ActiveX Data Objects (ADO). ADO.NET was designed from the ground up for distributed architectures, so that it can fit nicely in a networked world. The basic premise is that clients are not constantly connected to a data source. There has to be a convenient mechanism to store the data at the client, process them locally, and submit the updates to the database. This mechanism is the DataSet, which is something like a lightweight, in-memory database. A DataSet is a data structure for storing related tables, and it offers developers a relational view of the data.

ADO.NET is ideal for distributed, disconnected applications, but it's just as good for client/server applications and multi-tier connected applications. A thorough explanation of the architecture of ADO.NET and its classes would require another book, and there are many books on the topic. In this chapter you'll find an overview of the basic classes of ADO.NET and explanations of the techniques we'll use to build a few practical applications in Chapter 18. Our goal is to show you how to write practical data-driven Windows applications with functional, user-friendly interfaces.

As you might expect, Visual Studio .NET supports two approaches for building data-driven applications: a visual approach, which relies heavily on data-binding and wizards, and the programmatic approach. We'll focus on programming the ADO.NET classes. Data binding is convenient for building prototypes, but you can't expect to build professional data-driven applications with data-binding and point-and-click operations.

Accessing Databases

The basic tasks in working with databases are to establish a connection to a database, execute commands against the database, and move data to the client, where they'll be processed. The commands we execute may update some tables in the database and not return any data to the client (except for the number of rows that were affected by the command), or retrieve data and move them to the client. The ADO.NET architecture is based on a few fundamental classes that encapsulate these actions. The Connection class provides the functionality to establish a connection to a database, the Command class provides the functionality to execute a command against the database, and the DataSet class provides a convenient mechanism for storing data at the client. The

Team Fly 


Visual Basic  .NET Power Tools
Visual Basic .NET Power Tools
ISBN: 0782142427
EAN: 2147483647
Year: 2003
Pages: 178

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