ServerConnection.ExecuteScalar Method (StringCollection)

Executes a batch of Transact-SQL statements and returns the first column of the first row as an object value.

Namespace:  Microsoft.SqlServer.Management.Common
Assembly:  Microsoft.SqlServer.ConnectionInfo (in Microsoft.SqlServer.ConnectionInfo.dll)

Syntax

'Declaration
Public Function ExecuteScalar ( _
    sqlCommands As StringCollection _
) As Object()
'Usage
Dim instance As ServerConnection
Dim sqlCommands As StringCollection
Dim returnValue As Object()

returnValue = instance.ExecuteScalar(sqlCommands)
public Object[] ExecuteScalar(
    StringCollection sqlCommands
)
public:
array<Object^>^ ExecuteScalar(
    StringCollection^ sqlCommands
)
member ExecuteScalar : 
        sqlCommands:StringCollection -> Object[] 
public function ExecuteScalar(
    sqlCommands : StringCollection
) : Object[]

Parameters

Return Value

Type: array<System.Object[]
An object array value that specifies the first column of the first row for each result set.