When I try to do the following code, the program hangs indefinitely. I don\'t know why and there seems to be other unanswered topics on the matter. Although, if the IP\\webs
To get the connection to exit after a specified amount of time without success, you can use the Connection Timeout parameter in the connection string. The number you specify is in seconds, so for example, Connection Timeout=240 is equal to 240 seconds\60 seconds = 4 minutes.
Sample connection string:
In the above connection string, the Open() command will timeout after 10 seconds.