Use MySQLDataReader class:How do I change this to a for loop or while loop?
I want all the data to go in one by one instead of the Fill option.
Reason for this is there are data in the table that I would like to edit before it gets passed to the dataset.
Code:Private Function ConnectMe() As DataTable Dim conn As String = "Server=192.168.0.36;Port=3306;Database=wswc;Uid=root;Pwd=Jack" Dim cmd As String = "SELECT * FROM st_users" Dim rd As New MySql.Data.MySqlClient.MySqlDataReader(cmd, conn) While rd.Read ' Each loop the data reader will read one more data row returned by your query. ' rd.Item("fieldname") will contain the value of the fieldname of your table End While End Function




Reply With Quote
