Dim cn As New MySql.Data.MySqlClient.MySqlConnection("server=...; User ID=...; password=...; database=...")
Dim command As New MySqlCommand("select * from ...", cn)
Dim r As MySqlDataReader = command.ExecuteReader
Dim sb As StringBuilder = New StringBuilder()
TextBox2.Text = sb.ToString
Supply to the code some kind of marker for where it left off. An incrementing identifier for the messages? A timestamp? It's your data, so it's your call. But basically, if you were to look at the data in the database manually, what value would you look for to determine "where you left off"? That's the value you want.
Then it's just a matter of putting that value into the
WHERE clause. Something like this:
Dim command As New MySqlCommand("select * from SomeTable where MessageDate > @lastKnownDate", cn) command.Parameters.Add(new MySqlParameter("@lastKnownDate", lastKnownDate)) // lastKnownDate would be the DateTime variable passed to this code. // alternatively, use some other value as a "bookmark"