Compartilhar via


Método ServerConnection.ExecuteReader (String, SqlCommand%)

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

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

Sintaxe

'Declaração
Public Function ExecuteReader ( _
    sqlCommand As String, _
    <OutAttribute> ByRef command As SqlCommand _
) As SqlDataReader
'Uso
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

Parâmetros

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

Valor de retorno

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

Comentários

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

Consulte também

Referência

ServerConnection Classe

Sobrecarregado ExecuteReader

Namespace Microsoft.SqlServer.Management.Common