Solved

VB.NET - Windows form, a timer or pause

Posted on 2010-08-26
6
600 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 86

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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
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…

696 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