loviji
loviji

Reputation: 13080

How to implement AsyncCallback when importing rows?

I never used AsyncCallback. Need your help.

When In Windows Form app I importing rows application form freezes. To prevent it, i think I can use AsyncCallback.

foreach (DataRow dr in srcdt.Rows)
{
    desdt.ImportRow(dr);
}

and while importing rows, to show in lebel.Text imported row count. Some help please.

Upvotes: 0

Views: 104

Answers (1)

DavidGouge
DavidGouge

Reputation: 4623

Have a look at BackgroundWorker

This will allow you to kick off your long running process in another thread, receive progress reports and a completed event.

Upvotes: 1

Related Questions