Solved

Excel Upload to datagrid

Posted on 2011-09-24
2
236 Views
Last Modified: 2012-05-12
Hi Team,

Iam trying to upload Employee timesheet excel which consists of 12000 - 15000 records in datagrid in Windows Forms using VB.net.

While Uploading I want to verify that Id column in excel is an Active employee Id with database, as data is huge, screen is getting white [ as in busy process ] as it does reading and binding.

1. How I can make screen while binding active, how to show as it is progressing without system getting hanged. ?

2. If I do first upload of excel it is taking 1 min time, then if I do verify for employee id then screen is getting white as in busy process ?

Please suggest.

Dlsuser.
0
Comment
Question by:dlsUser
[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
2 Comments
 
LVL 2

Accepted Solution

by:
Lord_Death earned 250 total points
ID: 36594532
I Assume you have a loop for reading your excel file so :

you have to call the event handler for form to make it active.
Application.DoEvents(); is the line you have to write before your loop.
and update your progress bar.


this.progressBar1.Visible = true;
this.progressBar1.Minimum = 1;
this.progressBar1.Maximum = worksheet.Cells.MaxDataRow;
this.progressBar1.Value = 1;
this.progressBar1.Step = 1;
 // Loop through all files to copy.
 for (int i = 1; i <= worksheet.Cells.MaxRow; i++)
{
      Application.DoEvents();
     this.labelProgress.Text = worksheet.Cells[i, 0].Value.ToString() + " " + worksheet.Cells[i, 1].Value.ToString();
     this.progressBar1.PerformStep();
}//~For FileRows
0
 

Author Closing Comment

by:dlsUser
ID: 36594560
Thanks Alottttttt
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!

Question has a verified solution.

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

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

739 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