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.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Jaimin ShethiyaPosted Aug 5, 2020, 5:05 AM
try to below code.
foreach (DataRow row in dsLoad.Rows)
{
if(x==y)
{
continuee;
}
else if(y==z)
Thanks
Jenith ThakkarPosted Aug 3, 2020, 10:31 PM