Chapter 25: Data Access with .NET


Overview

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 and OleDbConnection 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 and OleDB 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, and DataColumn classes are discussed as well as the relationships between tables and constraints that are part of DataSet. 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.




Professional C# 2005 with .NET 3.0
Professional C# 2005 with .NET 3.0
ISBN: 470124725
EAN: N/A
Year: 2007
Pages: 427

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