Chapter 19. Data Access with .NET
This chapter discusses how to get at data from your C# programs using ADO.NET and covers the following details:
Connecting to the database—You learn how to use the
SqlConnection
andOleDbConnection
classes to connect to and disconnect from the database.Executing commands—ADO.NET has command objects, which can execute SQL commands or issue a stored procedure with return values. You learn the various command object options and see how commands can be used for each of the options presented by the
Sql
andOleDB
classes.Stored procedures—You learn how to call stored procedures with command objects, and how the results of those stored procedures can be integrated into the data cached on the client.
The ADO.NET object model—This is significantly different from the objects available with ADO, and the
DataSet, DataTable, DataRow
, andDataColumn
classes are discussed as well as the relationships between tables and constraints that are part ofDataSet
. The class hierarchy has changed significantly with version 2 of the .NET framework, and some of these changes are also described.Using XML and XML schemas—You examine the XML framework on which ADO.NET is built.
As is the case with the other chapters, you can download the code for the examples used in this chapter from the Wrox Web site at www.wrox.com
. The chapter begins with a brief tour of ADO.NET.
ADO.NET Overview
ADO.NET is more than just a thin veneer over some existing API. The similarity to ADO is fairly ...
Get Professional C# 2005 now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.