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?
holemaniaAsked:
Who is Participating?
 
ZhaolaiConnect With a Mentor Commented:
Use this:

System.Threading.Thread.Sleep(5000)


0
 
John (Yiannis) ToutountzoglouConnect With a Mentor Instructor Multiengine PilotCommented:
Somehow you need a delay function correct?
Dim StartTime As Date
                StartTime = Now
                While DateDiff("s", StartTime, Now) < 5
                End While
0
 
John (Yiannis) ToutountzoglouInstructor Multiengine PilotCommented:
Before that set your cursor to waitcursor ...then the function i wrote  then your update method...Finally set cursor  default...
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.