Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Distributed Applications / December 2003

Tip: Looking for answers? Try searching our database.

How to stop while loop

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Prasad - 31 Oct 2003 16:32 GMT
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.
- 30 Dec 2003 20:38 GMT
Thread.Sleep(2000)

>-----Original Message-----
>Hi:
[quoted text clipped - 29 lines]
>
>.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.