共用方式為


ExecuteReader 方法

Executes Transact-SQL statements that return one or multiple result sets.

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

語法

'宣告
Public Function ExecuteReader ( _
    sqlCommand As String _
) As SqlDataReader
'用途
Dim instance As ServerConnection
Dim sqlCommand As String
Dim returnValue As SqlDataReader

returnValue = instance.ExecuteReader(sqlCommand)
public SqlDataReader ExecuteReader(
    string sqlCommand
)
public:
SqlDataReader^ ExecuteReader(
    String^ sqlCommand
)
member ExecuteReader : 
        sqlCommand:string -> SqlDataReader 
public function ExecuteReader(
    sqlCommand : String
) : SqlDataReader

參數

傳回值

型別: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.

範例

呼叫方法