Tech
Forums
Jobs
Books
Events
Videos
Conference
Annual Conference
Bcrypt
Ai Conference
Live
More
Interviews
Certification
Training
Career
Members
News
Blogs
Contribute
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
2
Answers
How to show Progress bar until file creates?
Ask a question
Ask a question
Upload Source Code:
Select only zip and rar file.
RD Design
9y
721
1
Reply
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
Post
Reset
Cancel
Answers (
2
)
Next Recommended Forum
Convert code C# 2008 to code C# 2005 ?
Data Grid Colomns in the colomns