Public Sub Async_Exec(ByVal myConnection As OracleConnection)
Dim myCommand As New OracleCommand("SELECT * FROM Test.Dept", myConnection)
Console.WriteLine("Starting asynchronous retrieval of data...")
myConnection.Open()
Dim cres As IAsyncResult = myCommand.BeginExecuteReader(Nothing, Nothing, CommandBehavior.Default)
If cres.IsCompleted Then
Console.WriteLine("Completed.")
Else
Console.WriteLine("Have to wait for operation to complete...")
End If
Dim myReader As OracleDataReader = myCommand.EndExecuteReader(cres)
Try
While myReader.Read()
Console.WriteLine(String.Concat(myReader.GetInt32(0), " ", myReader.GetString(1), " ", myReader.GetString(2)))
End While
Finally
myReader.Close()
myConnection.Close()
End Try
End Sub