O'Reilly logo

Beginning C# 5.0 Databases, Second Edition by Vidya Vrat Agarwal

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

C H A P T E R  13

Executing ADO.NET Commands to Retrieve Data

Once you’ve established a connection to the database, you want to start interacting with it and getting it doing something useful for you. You may need to retrieve, add, update, or delete some data, or perhaps modify the database in some other way, usually by running a query. Whatever the task, it will inevitably involve a command.

In this chapter, we’ll explain commands, which are objects that encapsulate the T-SQL for the action you want to perform and that provide methods for submitting it to the database. Each data provider has a command class that implements the System.Data.IDbCommand interface.

In this chapter, we’ll cover the following:

  • Creating commands
  • Executing commands ...

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