TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
RD Design
NA
25
26.9k
How to show Progress bar until file creates?
Feb 25 2015 4:44 AM
Hi,
I have a code that reads sql db and pass results to iTextsharp to generate PDF files.This part is working perfectly.I have 1000 customers and reading those customers from db and I am passing result to iTextsharp pdf writer and generate PDF files.Now I need to show a progress bar.Tried so many ways but nothing is working well.Here is my code.
using (SqlConnection con2 = new SqlConnection(connectionString))
{
con2.Open();
using (SqlCommand command2 = new SqlCommand("SELECT * FROM dbo.Customers WHERE Customer = '" + cusNo.ToString() + "'", con2))
using (SqlDataReader reader2 = command2.ExecuteReader())
{
int i = 0;
while (i <= 0)
{
//Generate PDF
}
}
}
When while loop starts I need to show progress bar and when all PDF file processed I need to close progress bar.Tried backgroundworker
http://www.codeproject.com/Tips/83317/BackgroundWorker-and-ProgressBar-demo
But my issue is I cannot move above method inside
void
backgroundWorker1_DoWork()
Any ideas will really be helpful
Thanks
Reply
Answers (
2
)
Convert code C# 2008 to code C# 2005 ?
Data Grid Colomns in the colomns