Microsoft Press
Books designed for the different ways you learn. And across the range of Microsoft technologies. Welcome!
We’re pleased to announce that Tim Patrick’s new book Microsoft ADO.NET 4 Step by Step (ISBN 9780735638884; 440 pages), is now available for purchase!
ADO.NET is Microsoft's interface between your applications and your data. Using various providers and a little forethought and planning, you can access data from SQL Server, Oracle, or other databases in a generic way, such that changing providers requires either no or only minor changes to your application code. It's true: ADO.NET makes data access easier than ever before. Still, ADO.NET is big, and learning to use it effectively and efficiently can take some time. Tim Patrick has broken this complex topic into manageable chunks. Using the tried and true Step by Step approach, which gets you started by walking you through important procedures, he provides numerous tutorials that you can follow to get up to speed as fast as possible. After learning the basics of ADO.NET--connecting to databases, accessing data in tables, making dynamic queries and running stored procedures, you'll explore how to deal with that data through various readers, in-memory DataSets, and discover considerations for displaying, inserting, and modifying data. You'll learn about standards and security, data integrity, debugging, and then move into more advanced topics such as mapping data to classes using the Entity Framework, querying data with LINQ, both LINQ to SQL and LINQ to Entities, and finally, get an introduction to using ADO.NET for Windows Communication Foundation services, data binding to user interface elements, and in restful services. With the solid grounding that Microsoft® ADO.NET 4 Step by Step provides, you'll be building complex database applications in no time.
Here’s an excerpt from Chapter 6, “Turning Data into Information.”
After completing this chapter, you will be able to:
After you have joined DataTable instances together in a DataSet, ADO.NET enables a few more features that let you use those table relationships to analyze and select data. These features build upon some of the single-table functions covered in earlier chapters.
This chapter introduces the data-aggregation features included in the ADO.NET Framework, expressions that summarize data across multiple table rows. Although not as powerful as the aggregation features found in relational database systems, the DataTable variations still provide quick access to multirow data summaries. The chapter ends with an introduction to the DataView class, which lets you establish row selection, filtering, and sorting standards for a DataTable.
Note-- The exercises in this chapter all use the same sample project, a tool that demonstrates aggregate and data view features. Although you will be able to run the application after each exercise, the expected results for the full application might not appear until you complete all exercises in the chapter.
An aggregation function returns a single calculated value from a set of related values. Averages are one type of data aggregation; they calculate a single averaged value from an input of multiple source values. ADO.NET includes seven aggregation functions for use in expression columns and other DataTable features.
These seven data aggregation features appear as functions within ADO.NET expressions. Expressions were introduced in the “Using Expression Columns” section of Chapter 4, “Accessing the Right Data Values.” String expressions form the basis of custom expression columns and are also used in selecting subsets of DataTable rows. To aggregate data, use one of the following function formats as the expression string:
In ADO.NET, aggregates always summarize a single DataTable column. Each aggregate function considers only non-NULL column values. Rows that contain NULL values in the specified column are excluded from the aggregation. For example, if you take the average of a table column with 10 rows, but 3 of those rows contain NULL values in the column being averaged, the function will average only the 7 non-NULL values. This is especially useful with the Count function; it counts only the number of rows that have a non-NULL value for the passed column name. If all the column values are NULL, or if there are no rows to apply to the aggregation function, the result is NULL (System.DBNull).
It's great that someone decided to go "back to basics" and provide a fresh book focusing on core ADO.NET.
On my way to get it now :)
Cheers!
Anil
@anilmujagic: I agree! ADO.NET has been buried under LINQ and EF and others. Nice to see a book go back to ADO.NET.