One more DDT question...
 
Home My Account Forum Try It! Buy It!
About Contact Us Site Map
StrataFrame Forum
Home      Members   Calendar   Who's On
Welcome Guest ( Login | Register )
      



One more DDT question...Expand / Collapse
Author
Message
Posted 06/21/2007 11:59:37 AM
StrataFrame Novice

StrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame Novice

Group: Forum Members
Last Login: 04/11/2008 10:01:54 AM
Posts: 105, Visits: 650
I've basically copied the code from the DDT installer sample shipped with Strataframe to deploy my own pkg file. It seems to work fine up untill it starts deploying the data to the server.  I get an error in the TurnOffAllForeignKeys method.   While looking through this, the database parameter is set to the database name is the name of the database NameinProfile, not the NameOnServer.  All 3 databases getting deployed have a DatabaseTargetName specified.

'-- Create the DatabaseMigrator instance

If _SQLUserName.Length = 0 Then

_DatabaseSetup = New DatabaseMigrator(_SQLServer, True, Me)

Else

_DatabaseSetup = New DatabaseMigrator(_SQLServer, False, Me, _SQLUserName, _SQLPassword)

End If

'-- Create the DatabaseTargetName for Database1

Dim loDTN_Database1 As New DatabaseTargetName("Database1")

loDTN_Database1.NameOnServer = "Database1"

'-- Create the DatabaseTargetName for Database2

Dim loDTN_Database2 As New DatabaseTargetName("Database2")

loDTN_Database2.NameOnServer = "Database2_Renamed"

'-- Create the DatabaseTargetName for Database3

Dim loDTN_Database3 As New DatabaseTargetName("Database3")

loDTN_Database3.NameOnServer = "Database3"

'-- Create array to hold the DatabaseTargetName objects

Dim laDTNames(2) As DatabaseTargetName

laDTNames(0) = loDTN_Database1

laDTNames(1) = loDTN_Database2

laDTNames(2) = loDTN_Database3

'-- Begin the deployment of the databases

_DatabaseSetup.DeployMetaData(_Package, "mypassword", laDTNames)

It generates a Null Reference exception.  Stack Trace  :Microfour.StratFrame.DBEngine.SQL.DatabaseMigrator.TurnoffAllForeignKeys(String Databasename)

Am I doing something wrong here ?

Thanks,

Robin Giltner

Post #9708
Posted 06/22/2007 9:56:59 AM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: 06/17/2008 9:28:35 AM
Posts: 2,649, Visits: 1,863
I don't see where you're calling _DatabaseSetup.DeployData()... that method call should be the one that calls the TurnoffAllForeignKeys(), and as long as you pass that same laDTNames to it as well, it should work fine.


www.bungie.net
Post #9736
Posted 06/22/2007 10:37:51 AM
StrataFrame Novice

StrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame Novice

Group: Forum Members
Last Login: 04/11/2008 10:01:54 AM
Posts: 105, Visits: 650
Doh, thanks Ben.  I wasn't passing the DatabaseTargetNames array when I called the DeployData Function

Me._DatabaseSetup.DeployData(_Package, "password", laPKs.ToArray())

so I changed that to

Me._DatabaseSetup.DeployData(_Package, "password", laPKs.ToArray(), Me._DTNames)

Thanks Ben.

Robin Giltner

Post #9741
« Prev Topic | Next Topic »


Reading This TopicExpand / Collapse
Active Users: 1 (1 guest, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: Ben Chase, Trent L. Taylor, Steve L. Taylor

PermissionsExpand / Collapse

All times are GMT -6:00, Time now is 2:36am

Powered By InstantForum.NET v4.1.4 © 2008
Execution: 0.047. 10 queries. Compression Enabled.
Site Map - Home - My Account - Forum - About Us - Contact Us - Try It - Buy It

Microsoft, Visual Studio, and the Visual Studio logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries.