Posted on: 1/19/2012 9:56:16 PM | Views : 219

Hi,
I am currently using the code below to 'retry' a command if it causes an error the first time..
Is there a way to retry the code if it causes an error or doesn't have a result after .5 seconds? (only retry code with this time limit once, allow more time for next 2 attempts)?
Thanks!

bool flag = true;

for(int i=0; i<3; i++)
{

if(flag)
{

try
{
//code
}
catch (Exception ex)
{   //code
}
flag = false;
}
else
{
break;
}
} ...

Go to the complete details ...