OleDbCommand.Cancel Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Tries to cancel the execution of an OleDbCommand.
public:
override void Cancel();
public:
virtual void Cancel();
public override void Cancel ();
public void Cancel ();
override this.Cancel : unit -> unit
abstract member Cancel : unit -> unit
override this.Cancel : unit -> unit
Public Overrides Sub Cancel ()
Public Sub Cancel ()
Implements
Examples
The following example creates an OleDbCommand, executes it, and then cancels the execution. To accomplish this, the method is passed a string that is an SQL SELECT statement and a string to use to connect to the data source.
public void CreateCommand(string queryString, OleDbConnection connection)
{
OleDbCommand command = new OleDbCommand(queryString, connection);
command.Connection.Open();
command.ExecuteReader();
command.Cancel();
}
Public Sub CreateCommand _
(ByVal queryString As String, ByVal connection As OleDbConnection)
Dim command As New OleDbCommand(queryString, connection)
command.Connection.Open()
command.ExecuteReader()
command.Cancel()
End Sub
Remarks
If there is nothing to cancel, nothing occurs. However, if there is a command in process, and the attempt to cancel fails, no exception is generated.
Applies to
See also
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기