Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I have a form that loops through a file that could have 100,000 lines in it. Each line gets parsed and imported into a database, and functions perfectly. Unfortunately, it can take a significant amount of time to run the code.

 

I need to give the user some sort of indication that the application is functioning. I added a simple counter that updates after every record is loaded into the database, i.e.:

 

Label2.Text = "Loaded " & Cnt & " of " & RowCnt & " Records"
Label2.Update()

 

The label gets updated perfectly for approximately the first 1000 records. After that the form seems to lock up and appears to be "Non-Responsive". However, the app is still functioning. All the records get loaded into the database, and at the conclusion of the loop the label says, "Loaded 500 of 500 Records"

 

I also tried using a progress bar, but it yielded the same result.

 

Can someone clue me into what is wrong.

 

Thank you in advance

Go Beavs!!!
Posted

Not sure if this will help, since it is a loop instead of the label12.update I would use

Application.DoEvents

Live as if you were to die tomorrow. Learn as if you were to live forever.
Gandhi

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...