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
Mieke
NA
3
14.9k
Datareader counter for showing progress/cancel reading the data
Jan 10 2011 7:39 AM
hi,
I want to show in a seperate form the numbers (counter) of records read from a datareader.
I need this to show the progress and the option to cancel/stop the datareader from reading.
I don't know how to do it to get it works....RecordCounterForm is still empty :-(
// Mainform
..
..
RecordCounterForm rc = new RecordCounterForm();
int RecordCount = 0;
rc.ChildText = "Start met tellen";
rc.Show();
while (reader.Read())
{
RecordCount++;
rc.ChildText = RecordCount.ToString();
// if rc.CancelButton then stop
}
..
..
///childform with the counter
namespace Demo
{
public partial class RecordCounterForm : Form
{
public RecordCounterForm()
{
InitializeComponent();
}
public String ChildText
{
get { return txtChildText.Text; }
set { txtChildText.Text = value; }
}
private void btnCancel_Click(object sender, EventArgs e)
{
this.Close();
}
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
this.Close();
}
private void UpdateText(string ChildText)
{
txtChildText.Text = ChildText;
}
}
}
Reply
Answers (
3
)
how child form is completely fitted between menustrip and statusstrip in MDI form
need help about update