Object Reference for SqlCommand, SqlDataReader, and SqlParameter

Now that we’ve examined the major features of the SqlCommand, SqlDataReader, and SqlParameter classes, let’s examine the properties and methods of each object.

Properties of the SqlCommand Class

Table 4-1 lists the properties of the SqlCommand class that you’re most likely to use.

Table 4-1. Commonly Used Properties of the SqlCommand Class

Property

Data Type

Description

CommandText

String

The text of the query that you want to execute.

CommandTimeout

Int32

Time (in seconds) that the adapter will wait for the query to execute before timing out. (Default = 30 seconds.)

CommandType

CommandType

Specifies the type of query to execute. (Default = Text.)

Connection

SqlConnection

The connection to your data ...

Get Programming Microsoft® ADO.NET 2.0 Core Reference, 2nd Edition 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.