O'Reilly logo

Microsoft® Visual J#™ .NET (Core Reference) by John/Longshaw, Andy Sharp

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Executing Commands Against a Data Store

Once you’ve connected to a data store, you can execute commands against it. In this section, we’ll look at how you can build command objects and execute these against a connection. Specifically, we’ll look at how to invoke commands that return the following:

  • A single value, such as an aggregate value

  • A read-only data reader

  • An updatable, scrollable DataSet

Building Commands

The IDbCommand interface defines the functionality of a command class. Its two implementations, SqlCommand and OleDbCommand, expose the same properties and methods, with the exception that SqlCommand provides support for reading XML. (We’ll discuss this functionality later in this chapter). However, you use all command objects in the same ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required