共用方式為


ServerConnection.ExecuteScalar Method

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

備註

If multiple batches are specified by using a StringCollection object then the result is an array of value types.

只有 Microsoft .NET Framework 2.0 版支援此命名空間、類別或成員。

多載清單

名稱 Description
ServerConnection.ExecuteScalar (String)
Executes a Transact-SQL statement and returns the first column of the first row as an object value.
ServerConnection.ExecuteScalar (StringCollection)
Executes a batch of Transact-SQL statements and returns the first column of the first row as an object value.

請參閱

參考

ServerConnection Class
ServerConnection Members
Microsoft.SqlServer.Management.Common Namespace

其他資源

Calling Methods