共用方式為


ExecuteScalar 方法 (StringCollection)

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

命名空間:  Microsoft.SqlServer.Management.Common
組件:  Microsoft.SqlServer.ConnectionInfo (在 Microsoft.SqlServer.ConnectionInfo.dll 中)

語法

'宣告
Public Function ExecuteScalar ( _
    sqlCommands As StringCollection _
) As Object()
'用途
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[]

參數

傳回值

型別:array<System. . :: . .Object> [] () [] []
An object array value that specifies the first column of the first row for each result set.