• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 608
  • Last Modified:

VB.NET - Windows form, a timer or pause

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
holemania
Asked:
holemania
2 Solutions
 
John (Yiannis) ToutountzoglouCommented:
Somehow you need a delay function correct?
Dim StartTime As Date
                StartTime = Now
                While DateDiff("s", StartTime, Now) < 5
                End While
0
 
John (Yiannis) ToutountzoglouCommented:
Before that set your cursor to waitcursor ...then the function i wrote  then your update method...Finally set cursor  default...
0
 
ZhaolaiCommented:
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!

 
Mike TomlinsonMiddle School Assistant TeacherCommented:
0
 
sammlCommented:
Can you tell more about your code? Maybe there is a simpler more elegant solution than using wait commands. (Something with threads, ...)
0
 
holemaniaAuthor Commented:
Thanks that's all I needed.  Just to pause for a few seconds to let the job complete.
0

Featured Post

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!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now