hi guys,
I'm populating a datatable with this code:
now I need to create another command, datatable and datareader in this same function and add the rows of that datatable to the one above. What is the most efficient way of doing this?Code:Using con As New MySqlConnection(strCon) 'get users direct friends Dim cmd As MySqlCommand = New MySqlCommand("SELECT distinct f.* FROM friends f WHERE (f.UserID = ?UserID) AND (f.FriendUserID <> ?FriendUserID)", con) cmd.Parameters.AddWithValue("?UserID", UserID) cmd.Parameters.AddWithValue("?FriendUserID", UserID) con.Open() Dim reader As MySqlDataReader = cmd.ExecuteReader _data.Load(reader) con.Close() reader.Close() cmd.Dispose() end using




Reply With Quote