Hi guys,

I'm doing an application that works with an online mysql database.

Here is a sample of my code:

Dim adapter As New MySqlDataAdapter("select * from my_table order by code", "server=my_server;User Id=me;password=password;Persist Security Info=True;database=database")

Dim my_table = New DataTable


On the last line, the application freezes until the DataTable is filled. I realized that it doesn't happen with a local database.

Is there a way to avoid this?

Edited by pyTony: code tagging

5 Years
Discussion Span
Last Post by Mitja Bonca

76 is not that many rows, you could try to add a LIMIT 1 to your query to see if there's an improvement. As you're connecting to a remote db, it might be that the connection is really slow - no idea on how to work around that.


Please for vb code use ~~~ vb .... ~~~ fenced code tags if you use quote comments, otherwise you can select the code block and hit TAB.


Maybe there is a lot of columns?
There is nothing special about your code, maybe there is really a lot of data. Try creating a new thread, and put this code to run on it, you UI will be free to run.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.