Solved

VB.NET - Windows form, a timer or pause

Posted on 2010-08-26
6
595 Views
Last Modified: 2012-05-10
Hello experts,

I created a windows application that goes either update/insert to a database.  Once it does this, the database has a few triggers that runs and update a couple of things.  It normally takes about 5 seconds for it to complete.  Is there a way I can pause for like 5 seconds before it continues the next line of code to update/insert another table?
0
Comment
Question by:holemania
6 Comments
 
LVL 18

Assisted Solution

by:John (Yiannis) Toutountzoglou
John (Yiannis) Toutountzoglou earned 250 total points
ID: 33537167
Somehow you need a delay function correct?
Dim StartTime As Date
                StartTime = Now
                While DateDiff("s", StartTime, Now) < 5
                End While
0
 
LVL 18

Expert Comment

by:John (Yiannis) Toutountzoglou
ID: 33537181
Before that set your cursor to waitcursor ...then the function i wrote  then your update method...Finally set cursor  default...
0
 
LVL 17

Accepted Solution

by:
Zhaolai earned 250 total points
ID: 33537234
Use this:

System.Threading.Thread.Sleep(5000)


0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 85

Expert Comment

by:Mike Tomlinson
ID: 33537254
0
 
LVL 5

Expert Comment

by:samml
ID: 33548584
Can you tell more about your code? Maybe there is a simpler more elegant solution than using wait commands. (Something with threads, ...)
0
 

Author Closing Comment

by:holemania
ID: 33558029
Thanks that's all I needed.  Just to pause for a few seconds to let the job complete.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question