Executes the SQL statement. Returns Nothing/null if no record was selected, otherwise the first field from the returned result. ConnectionController.Start must be called prior to and ConnectionController.Finished afterwards or the statement be wrapped in a TransactionScope(). Otherwise the connection will not be correctly closed. If wrapped in a TransactionScope call then Start is implicitly called if it has not been called previously with the transaction scope.

Namespace: DatabaseObjects
Assembly: DatabaseObjects (in DatabaseObjects.dll) Version: 3.8.1.0

Syntax

C#
public Object ExecuteScalar(
	ISQLStatement objSQLStatement
)
Visual Basic
Public Function ExecuteScalar ( _
	objSQLStatement As ISQLStatement _
) As Object
Visual C++
public:
Object^ ExecuteScalar(
	ISQLStatement^ objSQLStatement
)

Parameters

objSQLStatement
Type: DatabaseObjects.SQL..::..ISQLStatement

[Missing <param name="objSQLStatement"/> documentation for "M:DatabaseObjects.Database.ConnectionController.ExecuteScalar(DatabaseObjects.SQL.ISQLStatement)"]

Return Value

[Missing <returns> documentation for "M:DatabaseObjects.Database.ConnectionController.ExecuteScalar(DatabaseObjects.SQL.ISQLStatement)"]

See Also