Executes the query, and returns the first column of the first row in the result set returned by the query. Note that extra columns and/or rows are ignored.
[Visual Basic] Public Function ExecuteScalar() _ Implements IDbCommand.ExecuteScalar As Object [C#] public object ExecuteScalar(); [C++] public: Object* ExecuteScalar(); [JScript] public function ExecuteScalar(): Object;
The first column of the first row in the result set. If the result set is empty, a null reference is returned.
| Exception Type | Condition |
|---|---|
| InvalidOperationException | The Connection is not Open. |
| MimerException | A database server error occurred while executing the statement. |
| ArgumentOutOfRangeException | The data value of a parameter value was too large or too small to be converted to the database type. |
| InvalidCastException | The format of the value of one of the Parameters was invalid, or the application data type can not be converted to the target database type. |
MimerCommand Class | Mimer.Data.Client Namespace