I have a SQL query where I need to pull email addresses if there is one associated with that row in my table. Depending on how many email addresses are returned could be 1 all the way up to 5 I need to send an email to each of those and then I need to update a field stating that the email was sent so one does not go out again. I know the code to send emails in C# but I do not know how to capture how many emails need to be sent, loop through them to send them and them update the field stating they have been sent. Help please.
Jesi523
0
Junior Poster in Training
Recommended Answers
Jump to PostYou may use RecordsAffected property of SQLDataReader for counting the number of emails sent per user, but as it is not set until all rows are read and you close the SqlDataReader, you must assign seperate datareader object to select all records per user.
All 5 Replies
Jesi523
0
Junior Poster in Training
Jesi523
0
Junior Poster in Training
harrypalmerr
0
Newbie Poster
Jesi523
0
Junior Poster in Training
Jesi523
0
Junior Poster in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.