How do I exit from if/else within FOR Loop( I should not exit from FOR loop)
foreach (DataRow row in dsLoad.Rows)
{
if(x==y)
{
exit from if//what do I add here(but I should not exit from FOR loop)
}
else if(y==z)
{
}
How do I exit from if/else within FOR Loop( I should not exit from FOR loop)
foreach (DataRow row in dsLoad.Rows)
{
if(x==y)
{
exit from if//what do I add here(but I should not exit from FOR loop)
}
else if(y==z)
{
}
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Jenith ThakkarRank #789 · 2.9K reputationPosted Aug 3, 2020, 6:31 PM EDT
Jaimin ShethiyaRank #177 · 13.7K reputationPosted Aug 5, 2020, 1:05 AM EDT
try to below code.
foreach (DataRow row in dsLoad.Rows)
{
if(x==y)
{
continuee;
}
else if(y==z)
Thanks