Hi:
See this code :
While iCommand.Connection.State = ConnectionState.Closed
Try
iCommand.Connection.Open()
Exit While
Catch ex As Exception
Console.Write(ex.ToString())
End Try
End While
In the above code, checking connection state if closed database connection
will be established. If any exception occurs while connecting, printing to
console and again try to connect to database. Here, in catch block, i want
to stop for 10 or 20 seconds while attempting to connect again (stop while
loop for some time). How can make it. Don't say use empty for loop in
catch block, after for completes, while loop will be continued. This is a
windows service and memeory usage is a big issue.
Thanks in advance.
-Prasad.
Laurie Paulin - 03 Nov 2003 05:17 GMT
System.Threading.Thread.Sleep(10000)
> Hi:
>
[quoted text clipped - 26 lines]
>
> -Prasad.
Thread.Sleep(2000)
>-----Original Message-----
>Hi:
[quoted text clipped - 29 lines]
>
>.