Solved

Excel Upload to datagrid

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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

706 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now