Method ExecuteScalar
ExecuteScalar(QueryCommand)
Executes the query, and returns the first column of the first row in the result set returned by the query. Additional columns or rows are ignored.
Declaration
object ExecuteScalar(QueryCommand queryCommand)
Parameters
| Type | Name | Description |
|---|---|---|
| QueryCommand | queryCommand | QueryCommand containing query text and values. |
Returns
| Type | Description |
|---|---|
| System.Object | The first column of the first row in the result set, or null if the result set is empty. |