StrataFrame Forum

How to get Database Name in Profile from the Package File

http://forum.strataframe.net/Topic21603.aspx

By Derek Price - 1/21/2009

I've created a command line version of SampleDataInstaller solution where you pass in the package path, sqlserver, username, and password. This deploys the database just like the DDT. Now I want to be able to pass in a different database name than what's in the package. I know the DatabaseMigrator method DeployMetaData() allows you to pass in a DatabaseTargetName array.



I guess the part I don't understand is how do I know what the database name in the profile is to pass to the DatabaseTargetName constructor? I tried looking into the PackageFile class, but that looks like a ton of work to extract the XML files and look in those, but I figured there must be an easier way.



What am I missing here?



Thanks,

Derek
By Derek Price - 1/21/2009

I think I just found what I needed:



var databaseNames = DatabaseMigrator.EnumDatabaseNames(PackagePath, FrameworkPassword);
By Trent L. Taylor - 1/21/2009

Yeah, that should do it.  Let me know if that wasn't what you were looking for.