Chapter 13. ADO.NET Connection and Command Objects

OBJECTIVES

  • Learn to create an ADO.NET Connection object

  • Learn to submit SQL through an ADO.NET Command object

In order to work with data, your application needs to be able to supply some important information. Among other things, you might need to provide answers to the following questions:

  • What data source do you want to use (SQL Server, Access/Jet, Oracle, DB2, and so on)?

  • Where is the data located (physical path or server name)?

  • How do you log in if security is involved?

Without this information, your application can't even find the data, much less use it. ADO.NET's Connection objects (specifically, OleDbConnection or SqlConnection) manage this information for you.

Before you can retrieve or ...

Get ASP.NET Developer's JumpStart 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.