Solved

Excel Upload to datagrid

Posted on 2011-09-24
2
231 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
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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

803 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