Is this:
// retry
for (int i = 0; i < length; ++i)
{
try
{
sqlCommand.ExecuteNonQuery();
}
catch (SqlException e)
{
if (e.Number == 64)
{
continue;
}
}
}
equivalent to:
// retry
for (int i = 0; i < length; ++i)
{
try
{
sqlCommand.ExecuteNonQuery();
}
catch (SqlException e) { }
}
(since the loop will continue anyway in latter case)
What is the difference (if any)?
continue
let you to skip the remaining statments in the current loop, and jump to the next iteration.
Given the code we have right now, it makes no difference. Since there is no more code after if (e.Number == 64) { continue; }
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With