共用方式為


ExecuteSql.GetDataReader 方法 (String, SqlCommand%)

不要直接在程式碼中參照此成員。其支援 SQL Server 基礎結構。 Gets a data reader to execute the specified Transact-SQL statements, and specifying a SqlCommand object that can be used to terminate a long-running query.

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

語法

'宣告
Public Function GetDataReader ( _
    query As String, _
    <OutAttribute> ByRef command As SqlCommand _
) As SqlDataReader
'用途
Dim instance As ExecuteSql 
Dim query As String 
Dim command As SqlCommand 
Dim returnValue As SqlDataReader 

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

參數

傳回值

型別:System.Data.SqlClient.SqlDataReader
A SqlDataReader object that can be used to process the result sets returned by the Transact-SQL statements.

請參閱

參考

ExecuteSql 類別

GetDataReader 多載

Microsoft.SqlServer.Management.Sdk.Sfc 命名空間