Imports System.Data.Odbc Module Module1 Private cn As OdbcConnection Private Dataadapter As OdbcDataAdapter Sub Main() Console.WriteLine("Give number of loop:") Dim Count As Integer = Console.ReadLine Dim ds As New DataSet Dim sql As String cn = New OdbcConnection("DSN=test") sql = "SELECT * FROM `table` where id= '1'" Try cn.Open() Dataadapter = New OdbcDataAdapter(sql, cn) Dataadapter.MissingSchemaAction = MissingSchemaAction.AddWithKey 'When removing this line the isue doesn't arise!!! Catch ex As Exception Console.WriteLine(ex.Message) Console.ReadLine() End End Try Do Try Dataadapter.Fill(ds, "table") Catch ex As Exception Console.WriteLine("Count:" & Count & vbCrLf & ex.Message) Exit Do End Try 'Do som work! If Count Mod 100 = 0 Then Console.Write(Count & ",(" & ds.Tables(0).Rows.Count & ")") End If ds.Tables("table").Clear() Count -= 1 Loop Until Count <= 0 Console.WriteLine("Finished, hit enter!") Console.ReadLine() End Sub End Module