共用方式為


ServerConnection.ExecuteReader 方法 (String, SqlCommand%)

Executes a reader using a SqlDataReader object value that contains one or more result sets.

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

語法

'宣告
Public Function ExecuteReader ( _
    sqlCommand As String, _
    <OutAttribute> ByRef command As SqlCommand _
) As SqlDataReader
'用途
Dim instance As ServerConnection 
Dim sqlCommand As String 
Dim command As SqlCommand 
Dim returnValue As SqlDataReader 

returnValue = instance.ExecuteReader(sqlCommand, _
    command)
public SqlDataReader ExecuteReader(
    string sqlCommand,
    out SqlCommand command
)
public:
SqlDataReader^ ExecuteReader(
    String^ sqlCommand, 
    [OutAttribute] SqlCommand^% command
)
member ExecuteReader : 
        sqlCommand:string * 
        command:SqlCommand byref -> SqlDataReader
public function ExecuteReader(
    sqlCommand : String, 
    command : SqlCommand
) : SqlDataReader

參數

  • sqlCommand
    型別:System.String
    A String value that specifies the Transact-SQL commands to be executed.

傳回值

型別:System.Data.SqlClient.SqlDataReader
A SqlDataReader object value that contains one or more result sets.

備註

The SqlDataReader object is returned to let the client process the data without requiring it to read all information into memory.

請參閱

參考

ServerConnection 類別

ExecuteReader 多載

Microsoft.SqlServer.Management.Common 命名空間