Click here to Skip to main content
15,895,084 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
HI All,
I am trying to implement progress bar for data transfer from an excel sheet to database using C# in windows application.
i have never worked on this kind earlier and need your valuable inputs on how to implement this.
Regards,
Ramakrishna
Posted

A very simple startup example here[^].
 
Share this answer
 
It is just very simple control yet powerful too,

Simply assume that your Excelsheet having 2000 rows and you want to transfer these rows to DB.

Just set MinimumValue to 0 and MaximumValue to 2000 you can set this to runtime also after you get rows count in excel.

and then just set StepSize = 1,

after each row insertion just use PerformStep method which will make the ProgressBar value increasing and finally set Value Properties of ProgressBar to again 0 to draw it in initial state,

You could have THIS[^] article to be useful.

Please vote and Accept Answer if it Helped.
 
Share this answer
 
Comments
ramakrishna Namburu 12-Oct-10 0:45am    
Hi Hiren,
Thanks for the reply. we are using the oledb commnd to upload data into the database and not really getting how to track whether each record has been inserted or not.
Hiren solanki 12-Oct-10 1:20am    
after executing nonquery method you could assume that data is inserted,increase step after each ExecuteNonQuery Method.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900