Share via


SqlCommand.EndExecuteReader(IAsyncResult) 메서드

정의

Transact-SQL 문의 비동기 실행을 완료하고 요청 SqlDataReader 된 를 반환합니다.

public:
 Microsoft::Data::SqlClient::SqlDataReader ^ EndExecuteReader(IAsyncResult ^ asyncResult);
public Microsoft.Data.SqlClient.SqlDataReader EndExecuteReader (IAsyncResult asyncResult);
member this.EndExecuteReader : IAsyncResult -> Microsoft.Data.SqlClient.SqlDataReader
Public Function EndExecuteReader (asyncResult As IAsyncResult) As SqlDataReader

매개 변수

asyncResult
IAsyncResult

IAsyncResult 대한 호출에서 반환되는 입니다 BeginExecuteReader() .

반환

요청된 행을 검색하는 데 사용할 수 있는 SqlDataReader 개체입니다.

예외

asyncResult 매개 변수가 null( Nothing Microsoft Visual Basic의 경우)

EndExecuteReader(IAsyncResult)는 단일 명령 실행을 위해 두 번 이상 호출되었거나 메서드가 해당 실행 메서드와 일치하지 않습니다(예: 에 대한 호출 BeginExecuteXmlReader() 실행을 완료하기 위해 호출된 EndExecuteReader(IAsyncResult) 코드).

예제

메서드의 사용을 EndExecuteReader 보여주는 예제는 를 참조하세요 BeginExecuteReader.

설명

를 호출 BeginExecuteReader 하여 Transact-SQL 문을 실행할 때 작업을 완료하려면 를 호출 EndExecuteReader 해야 합니다. 명령을 실행하는 프로세스가 아직 완료되지 않은 경우 이 메서드는 작업이 완료될 때까지 차단합니다. 사용자는 메서드에서 반환 BeginExecuteReader 된 인스턴스를 사용하여 명령이 IAsyncResult 작업을 완료했는지 확인할 수 있습니다. 에 대한 호출에서 콜백 프로시저를 지정한 경우 이 메서드를 BeginExecuteReader호출해야 합니다.

적용 대상