Solved

Excel Upload to datagrid

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

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

Question has a verified solution.

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

Suggested Solutions

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
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…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

856 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