ADO.NET Examples and Best Practices for C# Programmers

ADO.NET Examples and Best Practices for C# Programmers
Authors
William R. Vaughn, Peter Blackburn
ISBN
1590590120
Published
01 Apr 2002
Purchase online
amazon.com

For anyone who programs with databases in the new .NET in C#, ADO.NET Examples and Best Practices for C# Programmers shows you what works and what doesn't when it comes to Microsoft's latest APIs for working with databases. Filled with practical advice and recommended "best practices," this concise and useful book offers some valuable advice for anyone working with ADO.NET.While many C# titles cover Microsoft's

Editorial Reviews

Written specifically for COM-based ADO developers retooling for ADO.NET using the C# language, this book brings fresh insights and tips on the ADO.NET technology. Veteran authors William Vaughn and Peter Blackburn have packed this formative guide with practical advice on how to write code that is both faster running and easier to understand.

The onset of the new .NET technology is forcing developers to completely rethink their data access strategies. This book helps you to do this through working examples and numerous discussions of what works and what doesnt. Derived from years of experience working with data access developers, ADO.NET Examples and Best Practices for C# Programmers includes a set of techniques proven to drastically reduce overhead, problems, and confusionfor the devleoper, the system, and the entire team. While some are quite simple to implement, others require considerable forethought to enable. This is a developers bookfull of hints, tips and notes passed on from those whove spent significant time in the .NET and C# trenches.

Table of Contents

  1. Introducing ADO.NET
  2. ADO.NET—Getting Connected
  3. ADO.NET Command Strategies
  4. ADO.NET DataReader Strategies
  5. Using the DataTable and DataSet
  6. Filtering, Sorting, and Finding
  7. ADO.NET Update Strategies
  8. ADO.NET Constraint Strategies
  9. ADO.NET Exception Management Strategies
  10. ADO.NET and XML

For anyone who programs with databases in the new .NET in C#, ADO.NET Examples and Best Practices for C# Programmers shows you what works and what doesn't when it comes to Microsoft's latest APIs for working with databases. Filled with practical advice and recommended "best practices," this concise and useful book offers some valuable advice for anyone working with ADO.NET.

While many C# titles cover Microsoft's .NET Framework in its entirety, the focus on the APIs and programming strategies for databases makes this one a standout. This edition of the book is actually a rewrite of William Vaughn's older title, ADO Examples and Best Practices, but it adopts the same focus in showing how to do the job right when it comes to databases. The authors are clear about relating what's new and improved with ADO.NET compared to the earlier COM-based standard (referred to here as "ADOc"). Early sections delve into connecting to ADO.NET data sources (using SQL Server and ODBC).

The focus on "best practices" for fast, correct code begins with a full tour of using Command objects in ADO.NET, with hints for getting to parameters in SQL code (including stored procedures). A winning feature here is the information on Visual Studio .NET wizards for programming with database objects. (The wizard support is surprisingly powerful, and the authors show you how to start with wizard-generated code and then customize it yourself.)

The fastest way to get to data in ADO.NET is arguably using a DataReader class. Coverage here is followed by a richer tour of the options using DataTable and DataSet, which allow you to define new table structures, including relational data and disconnected data sets. Good features in this text are the authors' benchmarks for determining how to dig into ADO.NET collections to quickly find individual column data within a record. (Certain coding conventions here can really ruin performance, and you'll learn what to avoid.)

The book rounds out with a tour of XML support available in ADO.NET, including how to pass data in and out of databases through XML. A useful example that shows a Web service exposing a bit of ADO.NET database code will let you extend your ADO.NET programs across servers. A brief introduction to the relevant standards in Web services like SOAP will help you understand what goes into Web services.

Databases are a part of most every business application, so .NET developers will need to master new APIs and programming strategies in a hurry. This title fits the bill, with a handy and fast-moving tutorial that will get you going confidently with .NET and databases. --Richard Dragan

Topics covered: COM-based ActiveX Data Objects (ADOc) and ADO.NET compared; overview of ADO.NET classes and features (including XML support, data providers, disconnected data sets); connecting to data with SQL, ODBC, and ADOc data providers; using ADO.NET command objects in detail (including stored procedures and IDE support); using the ADO.NET DataReader object for fast, read-only queries; using the DataTable and DataSet objects (including building tables on the fly); filtering, sorting, and searching techniques with ADO.NET (including the DataView object); updating data with ADO.NET (adding, editing and deleting rows, validation, update strategies, using identity fields); using .NET constraints (including unique and foreign key constraints; DataRelation objects); structured exception handling with ADO.NET; XML support in ADO.NET (including DataSet XML features, DiffGrams, XML Schema); a Web service example with XML and a data set; SOAP explained; benchmark data for best practices with ADO.NET; using the DataAdapter Configuration Wizard (DACW) and other Visual Studio .NET wizards.

You might also like...

Comments

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Perl - The only language that looks the same before and after RSA encryption.” - Keith Bostic