tgf-47
Member
- Joined
- Feb 16, 2010
- Messages
- 15
- Programming Experience
- Beginner
I want to modify this function to populate an array with each item in the database.
I have tried various options, but I just can't get it to work
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 ad As New MySql.Data.MySqlClient.MySqlDataAdapter(cmd, conn)
Dim topics As New DataSet()
ad.Fill(topics)
ConnectMe = topics.Tables(0)
End Function
Instsead of fill, I want to one by one add it to the dataset and also an array
I have tried various options, but I just can't get it to work
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 ad As New MySql.Data.MySqlClient.MySqlDataAdapter(cmd, conn)
Dim topics As New DataSet()
ad.Fill(topics)
ConnectMe = topics.Tables(0)
End Function
Instsead of fill, I want to one by one add it to the dataset and also an array