I have the function in my class, which gets querystring and returns the two dimensional object array:
Public Function GetResultsBySql(ByVal sql As String) As Object(,)
Dim b(,) As Object = Nothing
Dim Command As New MySqlCommand(sql)
Dim rowCount As Int32 = -1
Using Conn As New MySqlConnection(Me.ConnectionString)
Command.Connection = Conn
Command.CommandTimeout = TimeOut
Try
Conn.Open()
Dim Dr As MySqlDataReader = Command.ExecuteReader
Do While Dr.Read
rowCount += 1
ReDim Preserve b(Dr.FieldCount - 1, rowCount)
For j As Int16 = 0 To Dr.FieldCount - 1
b(j, rowCount) = Dr(j)
Next
Loop
Return b
Catch ex As Exception
MsgBox(ex.Message.ToString, , "GetResultsBySql")
Return Nothing
End Try
End Using ' Connection
End Function
When I provide query which originally returns 156000 records. (In toad for mysql), object array contains only 71875 records. It's due to DataReader limits or due to leak operating memory? No exception is thrown.
Any Ideas?