Is there a way to know that the DatabaseMigrator.DeployMetaData is finished programatically


Author
Message
Cory Cookson
Cory Cookson
StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)
Group: Forum Members
Posts: 30, Visits: 416
Hello all,

I am trying to build, deploy, and the run another process against a Database all under one button.  The problem is that I don't know when the DeployMetaData is finished before moving on.

Is there a way for me to know that the process has finished from within c#?

As always thanks for the help Wink

-Cory

Cory Cookson

Software Developer

Occupational Health Research

Ivan George Borges
Ivan George Borges
Strategic Support Team Member (2.8K reputation)Strategic Support Team Member (2.8K reputation)Strategic Support Team Member (2.8K reputation)Strategic Support Team Member (2.8K reputation)Strategic Support Team Member (2.8K reputation)Strategic Support Team Member (2.8K reputation)Strategic Support Team Member (2.8K reputation)Strategic Support Team Member (2.8K reputation)Strategic Support Team Member (2.8K reputation)
Group: StrataFrame MVPs
Posts: 1.9K, Visits: 21K
Hi Cory.

Would the DDT Profile Scripts be the case?

Have a look at the help file under the Database Deployment Toolkit / Profile Scripts. You can tell it to run Pre or Post Deployment.

Trent Taylor
Trent Taylor
StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
If you are trying to do this all through T-SQL, then Ivan's suggestion of the Profile scripts may be helpful.  However, if you are just wanting to do something outside of the DDT altogether, and I assume that you are using the database Migrator, then there are events that tell you each phase of what is going on, including when the meta-data has been completed.  For a sample of these events, look at the Database Installer Sample.
Cory Cookson
Cory Cookson
StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)
Group: Forum Members
Posts: 30, Visits: 416
Howdy,

I am currently having issues opening the solution for the Database INstaller (tells me that the vbproj files don't exists) but I have opened up the files in the solution seperately as well as serached the project files through Widows search for "BuildComplete" as this is the event that I'd like to use and am unable to find an example of it.

Could someone post an example of how to create the event handler and use this event?

Thanks for all the help,

Cory



Cory Cookson

Software Developer

Occupational Health Research

Ivan George Borges
Ivan George Borges
Strategic Support Team Member (2.8K reputation)Strategic Support Team Member (2.8K reputation)Strategic Support Team Member (2.8K reputation)Strategic Support Team Member (2.8K reputation)Strategic Support Team Member (2.8K reputation)Strategic Support Team Member (2.8K reputation)Strategic Support Team Member (2.8K reputation)Strategic Support Team Member (2.8K reputation)Strategic Support Team Member (2.8K reputation)
Group: StrataFrame MVPs
Posts: 1.9K, Visits: 21K
Cory.

Not sure why you can't open the solution. Maybe you could try installing them again.

Anyway, if you can open the project, go to the SampleDataInstallerClass and have a look at the code of the DataProgress.vc (or DataProgress.cs, as I think you are doing C#) and check how the _DatabaseSetup is declared as MicroFour.StrataFrame.DBEngine.SQL.DatabaseMigrator.

If you check the "Handled Events" region, you will find a _DatabaseSetup_DeployDataComplete routine, that closes the form when done.

    ''' <summary>
    ''' Indicates that the data deployment started by the DeployData command is complete
    ''' </summary>
    ''' <param name="e"></param>
    ''' <remarks></remarks>
    Private Sub _DatabaseSetup_DeployDataComplete(ByVal e As MicroFour.StrataFrame.DBEngine.SQL.SQLManagerEventArgs) Handles _DatabaseSetup.DeployDataComplete
        '-- Since we are finished, close the form with a good result
        DialogResult = Windows.Forms.DialogResult.OK
    End Sub


Cory Cookson
Cory Cookson
StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)
Group: Forum Members
Posts: 30, Visits: 416
I think I understand, however in c# there is no withevents for the databaseMigrator object and I'm having considerable issues making the event handler for it.  Here is what I have.  The Question mark indicates where I have no idea what to enter.  As always I appreciate the help:

private DatabaseMigrator _DatabaseSetup;

public DataDeployment()

{

this._DatabaseSetup.BuildComplete += new DatabaseMigrator.BuildCompleteEventHandler(?);

}



Cory Cookson

Software Developer

Occupational Health Research

Ivan George Borges
Ivan George Borges
Strategic Support Team Member (2.8K reputation)Strategic Support Team Member (2.8K reputation)Strategic Support Team Member (2.8K reputation)Strategic Support Team Member (2.8K reputation)Strategic Support Team Member (2.8K reputation)Strategic Support Team Member (2.8K reputation)Strategic Support Team Member (2.8K reputation)Strategic Support Team Member (2.8K reputation)Strategic Support Team Member (2.8K reputation)
Group: StrataFrame MVPs
Posts: 1.9K, Visits: 21K
I assume you were not able to open the C# SampleDataInstallerClass project.

But here are the lines for the _DatabaseSetup, although I think you would get some more ideas having a look at the DataProgress.cs.

private MicroFour.StrataFrame.DBEngine.SQL.DatabaseMigrator _DatabaseSetup;

//-- Create the handlers

_DatabaseSetup.DeployDataComplete += new MicroFour.StrataFrame.DBEngine.SQL.DatabaseMigrator.DeployDataCompleteEventHandler(_DatabaseSetup_DeployDataComplete);

/// <summary>

/// Indicates that the data deployment started by the DeployData command is complete

/// </summary>

/// <param name="e"></param>

/// <remarks></remarks>

private void _DatabaseSetup_DeployDataComplete(MicroFour.StrataFrame.DBEngine.SQL.SQLManagerEventArgs e)

{

//-- Since we are finished, close the form with a good result

DialogResult = System.Windows.Forms.DialogResult.OK;

}


Cory Cookson
Cory Cookson
StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)
Group: Forum Members
Posts: 30, Visits: 416
No I'm not able to open the sample code at all.

I appreciate the help.

Cory Cookson

Software Developer

Occupational Health Research

Cory Cookson
Cory Cookson
StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)
Group: Forum Members
Posts: 30, Visits: 416
I was able to use the samples Ivan produced to get the needed event to fire. 

Thanks Ivan!

-Cory

Cory Cookson

Software Developer

Occupational Health Research

Ivan George Borges
Ivan George Borges
Strategic Support Team Member (2.8K reputation)Strategic Support Team Member (2.8K reputation)Strategic Support Team Member (2.8K reputation)Strategic Support Team Member (2.8K reputation)Strategic Support Team Member (2.8K reputation)Strategic Support Team Member (2.8K reputation)Strategic Support Team Member (2.8K reputation)Strategic Support Team Member (2.8K reputation)Strategic Support Team Member (2.8K reputation)
Group: StrataFrame MVPs
Posts: 1.9K, Visits: 21K
Glad you got it going, Cory! Cool
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search