Chapter 9. Querying Databases

After completing this chapter, you will be able to:

  • Issue data-modifying queries on external data sources

  • Retrieve a table of records from a SQL Server database

  • Return the primary key value for a newly inserted database record

Despite its capability to work with data generated completely within an application, ADO.NET’s main purpose is to access and manipulate data in external data stores. To enable this query-and-update functionality on the source data platform, ADO.NET includes a “command” object, a wrapper around a platform-specific query that updates, inserts, or deletes target data; or returns single or multiple values from the data source.

This chapter introduces this command wrapper, and demonstrates how to process ...

Get Microsoft® ADO.NET 4 Step by Step 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.