ExecuteScalar 方法

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

此成员被重载。有关此成员的完整信息,包括语法、用法和示例,请单击重载列表中的名称。

重载列表

  名称 说明
公共方法 ExecuteScalar(StringCollection) Executes a batch of Transact-SQL statements and returns the first column of the first row as an object value.
公共方法 ExecuteScalar(String) Executes a Transact-SQL statement and returns the first column of the first row as an object value.

页首

注释

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