The following code throws a NotSupportedException:
Code: Select all
.
.
Private connection as MySqlConnection
.
.
Private Sub Connect()
connection = New MySqlConnection
connection.UserId = "userid"
connection.Password = "password"
connection.Host = "192.168.1.1"
connection.Database = "localdb"
Dim delegate_endConnect As New AsyncCallback(AddressOf EndConnect)
Dim state_object As New Object
Try
Dim ar As IAsyncResult = connection.BeginOpen(delegate_endConnect, state_object)
Catch ex as Exception
' Display exception
End Try
End Sub
Private Sub EndConnect(ByVal ar As IAsyncResult)
connection.EndOpen(ar)
If ar.IsCompleted = True Then
' Connected
' Perform actions...
Else
' Not connected, displaying error message
End If
End Sub
Code: Select all
NotSupportedException
frmConnecting::Connect+0x50
frmConnecting::frmConnecting_Load+0x16
Form::OnLoad+0x15
Form::_SetVisibleNotify+0x1d
Control::set_Visible+0x1f
Application::Run+0x7
frmConnecting::Main+0xd
(Note: I'm using version 3.50.10.1 of CoreLab.MySql)