I don't seem to be able to close the OledbDataReader object after reading data from it. Here is the relevant code -
Dim conSyBase As New OleDb.OleDbConnection("Provider=Sybase.ASEOLEDBProvider.2;Server Name=xx.xx.xx.xx;Server Port Address=5000;Initial Catalog=xxxxxxxxxx;User ID=xxxxxxxx;Password=xxxxxxxxx;")
conSyBase.Open()
Dim cmdSyBase As New OleDb.OleDbCommand("MySQLStatement", conSyBase)
Dim drSyBase As OleDb.OleDbDataReader = cmdSyBase.ExecuteReader
Try
While drSyBase.Read
/*Do some stuff with the data here */
End While
Catch ex As Exception
NotifyError(ex, "Read failed.")
End Try
drSyBase.Close() /* CODE HANGS HERE */
conSyBase.Close()
drSyBase.Dispose()
cmdSyBase.Dispose()
conSyBase.Dispose()
The console application just hangs at the point at which I try to close the reader. Opening and closing a connection is not a problem, therefore does anyone have any ideas for what may be causing this?