Mondeo Posted January 19, 2007 Posted January 19, 2007 I have this simple for each loop For each row as datarow in dtResults.rows ' Send the email Next Now I dont want to send the email everytime based on the value in one of the columns in dtResults, so I need For each row as datarow in dtResults.rows If row.item(0).tostring = "" then Next End If ' Send the email Next However this will not compile, it there anyway I can call the next in two different places based on logic? Thanks Quote
MrPaul Posted January 19, 2007 Posted January 19, 2007 (edited) Continue The keyword you are looking for is Continue: For Each row As DataRow In dtResults.Rows If (row.Item(0).ToString = "") Then Continue For ' Send the email Next Good luck :) Edited January 19, 2007 by MrPaul Quote Never trouble another for what you can do for yourself.
mskeel Posted January 19, 2007 Posted January 19, 2007 That seems awkward. Why not... For Each row as datarow in dtResults.Rows If row.item(0).tostring <> "" Then ''If it's a good row for sending an email 'send the email End If Next Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.