SqlCommand.EndExecuteReader(IAsyncResult) 메서드

정의

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

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

매개 변수

asyncResult
IAsyncResult

IAsyncResult 호출에서 반환된 BeginExecuteReader()입니다.

반환

SqlDataReader

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

예외

asyncResult 매개 변수는 null(Microsoft Visual Basic의 Nothing)입니다.

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

예제

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

설명

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

적용 대상

추가 정보