User-1770812916 posted
Hello
I have some difficulties to create 2 loops in a datatable or datareader. The goal : create a text body for sending an email to each user.
I explain me ..
With a sql query I get back a table with the columns idname, username, and operation.
With is I create a datatable or datareader and I want to loop in and send an email for each user with concatenating all the operations for each user.
A sample of my table
1 user1 text1
1 user1 text2
2 user2 text1
2 user2 text2
2 user2 text3
3 user3 text1 ...
I would like to do a first loop on the ID user and for each ID user do an another loop to concatenate the differents texts and send an email. And pass to the next user and do the same thing until the last user.
What is the best way to do it ?
Tanks a lot for your help.
Fabrice
Je voudrais envoyer un email à dupont listant tous les types d'achat
Et la même chose pour durant et les autres.
Comment organiser les boucles. Faire une première boucle tant que le nom est dupont et faire une sous boucle sur le type d'achat tant que le nom est dupont et envoyer le mail. Puis faire la meme chose avec le nom suivant ..;
Merci de votre aide
fabrice