Gemstone Data Library
Show/Hide TOC

# AdoDataConnectionExecuteScalar(Int32, String, Object) Method

Executes the SQL statement using Connection, and returns the value in the first column of the first row in the result set.

## Definition

Namespace: Gemstone.Data
Assembly: Gemstone.Data (in Gemstone.Data.dll) Version: 1.0.163 -- Release Build+b7c062313779c243eb4689aaf08bfd5bae61c6da
C#
View Source Request Example

    public Object? ExecuteScalar(
    	int timeout,
    	string sqlFormat,
    	params Object?[] parameters
    )

VB
View Source Request Example

    Public Function ExecuteScalar (
    	timeout As Integer,
    	sqlFormat As String,
    	ParamArray parameters As Object()
    ) As Object

C++
View Source Request Example

    public:
    Object^ ExecuteScalar(
    	int timeout,
    	String^ sqlFormat,
    	... array<Object^>^ parameters
    )

JavaScript
View Source Request Example

    function ExecuteScalar(timeout, sqlFormat, ... parameters);

#### Parameters

timeout Int32
  The time in seconds to wait for the SQL statement to execute.
sqlFormat String
  Format string for the SQL statement to be executed.
parameters Object
  The parameter values to be used to fill in DbParameter parameters.

#### Return Value

Object
Value in the first column of the first row in the result set.

## See Also

#### Reference

AdoDataConnection Class
ExecuteScalar Overload
Gemstone.Data Namespace