ADO.NET 3.5 Cookbook

Dennis Hayes

October 30, 2009

3 Min Read
ITPro Today logo

PRObooks

 

ADO.NET 3.5 Cookbook

One reason I often buy a book is because it solves a particularproblem I am having writing an application; solving one problem in the middleof a project can easily be worth the price of a book (which is why I like thewhole O Reilly series of Cookbooks).

 

For example, let s look at the first recipe in BillHamilton s ADO.NET 3.5 Cookbook, StoringConnection Strings. If you are new to .NET database programming (and maybeeven if you are not so new), you need to know how to store database connectionstrings. In .NET you have a number of options as to where to store connectionstrings. What are they, and which one is right for your situation? This recipecovers storing connection strings in the application, the registry, UniversalData Link files (UDL), and custom files. This section explains the advantagesand disadvantages, security ramifications, and ease of modifying each; it also providesdetailed instructions on how to use each of the preferred options. The bookcontinues to do this for more than two hundred recipes divided into twelvechapters.

 

The first chapter covers connecting to databases,including connecting to databases using Excel and text files, and how to useconnection pooling. Chapter 2 details working with disconnected data objects.Chapter 3 goes over retrieving data from databases, including hierarchical data;reading data from databases, text files, and Excel worksheets; and queryingusing LINQ. Chapter 4 explains how to search and analyze data, includingsorting, filtering, recursive queries, and even how to access deleted rows (butonly before AcceptChanges is called). Chapter 5 covers adding and modifyingdata.

 

Chapter 6 details copying and transferring data. It coversmoving data between data tables, as well as between data tables, data sets, anddata readers. It also explains how to serialize and deserialize data. It showshow to export the results of a query to a string or an array. As a bonus, itshows how to read and write from and to legacy ADO databases.

 

Chapter 7 details maintaining database integrity usingtransactions, checking for concurrency conflicts, resolving data conflicts, andusing column expressions to enforce business rules. Chapter 8 has completecoverage of data binding in both Web Forms and Windows Forms. Chapter 9 coversXML data, including schemas, XPath, and SQL Server XML data.

 

Chapter 10 shows how to optimize data access in .NET withexamples of executing multiple commands on a single connection, bulk loadingand copying, batch updates, and working with large data from Oracle databases.

 

Chapter 11 explains how to work with database metadata,including retrieving metadata, and information on columns (length, defaulttypes, etc.). It details how to retrieve a SQL Server query plan (I didn t knowyou could do that with software). It shows how to create new databases and addtables and relationships to a database. It continues with how to enumeratedifferent types of data providers (.NET, OLE DB, ODBC, SQL), and closes byshowing how to programmatically change SQL Server passwords.

 

The final chapter covers CLR integration, which allows theuse of .NET inside SQL Server, such as using C# or other .NET-compatiblelanguages to create stored procedures. The book ends with an appendix thatlists the changes in ADO.NET since version 1.0.

 

This Cookbookhas an incredible 900+ pages of short examples showing how to perform specifictasks. If you are an experienced ADO.NET programmer, this book will pay foritself many times over by speeding you through everyday tasks. If you arelearning ADO.NET, the best way is by writing ADO.NET code this book will keepyou from getting stuck by showing not only the how, but the why of codingADO.NET. Regardless of your skill level, this is a book you cannot afford to bewithout.

 

Dennis Hayes

 

Rating:

Title: ADO.NET 3.5 Cookbook

Author: BillHamilton

Publisher: O Reilly

ISBN: 978-0-596-10140-4

Web Site: http://www.oreilly.com

Price: US$54.99

Page Count: 980

 

 

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like