Welcome Guest Search | Active Topics | Sign In | Register

use ProgressBar with SMO (backup or restore) Options
dvilner
Posted: Thursday, July 8, 2010 6:31:48 PM
Rank: Newbie
Groups: Member

Joined: 7/8/2010
Posts: 1
Is there any way I can use the ProgressBar control to work with SMO as far as tracking the progress of a database operation?

Here's a code snippet:

Code: C#
Backup bkp = new Backup();
bkp.Devices.AddDevice(@"C:\test.bak", DeviceType.File);
bkp.Database = "test_db";
bkp.Action = BackupActionType.Database;
bkp.Initialize = true;
bkp.PercentCompleteNotification = 1;
bkp.PercentComplete += new 
PercentCompleteEventHandler(bkp_PercentComplete);          
bkp.SqlBackup(op_svr);


The problem is the handler for the PercentComplete: even though I can put the backup code inside the ProgressBar's RunTask method, the tracking of the backup's progress is handled by "PercentCompleteEventHandler", thus I never have a chance to run UpdateProgress...

Thanks in advance!
eo_support
Posted: Thursday, July 8, 2010 7:03:21 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

We do not provide free tech support for our free controls unless you have a license for our product. So you may want to take a look of the sample code and see if you can find any similarity between your scenario and the sample code --- or write some wrapping code to wrap around your code so that you can use it the same way as the sample code:

http://demo.essentialobjects.com/Demos/Progress%20Bar/Server%20Side%20Task/Demo.aspx

In any case, the final code structure has to look like what’s in the sample because that’s how the progress bar works.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.