B.1. Some General Concepts

Before we get going too deep with "just code," there are a few key constructs that we need to understand. There are several different connectivity models that have come and gone over time — you'll hear about such names as OLE-DB, ODBC, and, of course, ADO among others. The connectivity model of the day these days is ADO.NET. Given the life span of these things, I wouldn't be surprised at all if there were yet a different one by the time the next version of SQL Server comes out.

Even with all the different models that have come and gone, some concepts seem to always exist in every object model — let's take a look at these real quick:

  • Connection — The connection object is pretty much what it sounds like — the object that defines and establishes your actual communications link to your database. The kinds of parameter information that will exist for a connection object include such things as the username, password, database, and server you wish to connect to. Some of the methods that will exist include such things as connect and disconnect.

  • Command — This object is the one that carries information about what it is you want to do. Some object models will not include this object, or at least not feature it, but the concept is always there (it is sometimes hidden as a method ofthe connection object).

  • Data set — This is the result of a query — that is, if the query returns data. Some queries you execute — for example, a simple INSERT statement — will not return ...

Get Professional SQL Server™ 2005 Programming 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.