Compartilhar via


Método ExecuteScalar (String)

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

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

Sintaxe

'Declaração
Public Function ExecuteScalar ( _
    sqlCommand As String _
) As Object
'Uso
Dim instance As ServerConnection
Dim sqlCommand As String
Dim returnValue As Object

returnValue = instance.ExecuteScalar(sqlCommand)
public Object ExecuteScalar(
    string sqlCommand
)
public:
Object^ ExecuteScalar(
    String^ sqlCommand
)
member ExecuteScalar : 
        sqlCommand:string -> Object 
public function ExecuteScalar(
    sqlCommand : String
) : Object

Parâmetros

Valor de retorno

Tipo: System. . :: . .Object
An Object system object value that specifies the first column of the first row of the result set.