Database name (local/remote)


Author
Message
Chan
Chan
Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)
Group: Forum Members
Posts: 533, Visits: 2K
Hi,

Do you meant any view/stored procedure that access remote database got to be maintain seperately? Then, in DDT pre/post script ask migrator class to execute it?



Thank you
Keith Chisarik
Keith Chisarik
StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)
Group: StrataFrame Users
Posts: 939, Visits: 40K
1) If using ASP.NET (I think you do from past posts) when you go to do #1, you will find that the database migrator class looks for a control/object that supports INVOKE as the third parameter, since web controls dont you will have to create your own as a workaround. I have a web application that allows users to do just this, name and create their own databases. I just add a _XXX identifier to them so I know which ones to update when it comes time.

Public Class DBMigratorInvokeObject

Implements System.ComponentModel.ISynchronizeInvoke

Public Function BeginInvoke(ByVal method As System.Delegate, ByVal args() As Object) As System.IAsyncResult Implements System.ComponentModel.ISynchronizeInvoke.BeginInvoke

Throw New NotSupportedException()

End Function

Public Function EndInvoke(ByVal result As System.IAsyncResult) As Object Implements System.ComponentModel.ISynchronizeInvoke.EndInvoke

Throw New NotSupportedException()

End Function

Public Function Invoke(ByVal method As System.Delegate, ByVal args() As Object) As Object Implements System.ComponentModel.ISynchronizeInvoke.Invoke

Return method.DynamicInvoke(args)

End Function

Public ReadOnly Property InvokeRequired() As Boolean Implements System.ComponentModel.ISynchronizeInvoke.InvokeRequired

Get

Return True

End Get

End Property

End Class



Keith Chisarik
Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
1. How could I allow user to decide database name during DDT deployment?

Well, there are a number of ways to do this.  In our medical application, we have a custom installer (see the Database Installer Sample for an idea about this) where we deploy our structures.  During our installation, we check to see if this is a new install or another instance.  If this is a new instance, we ask them for an instance name where we then tack on the instance name to the database (i.e. MyNewInstance_MyDatabaseName).  You have 100% control of the database name if using the DatabaseMigrator class.

The second option would be to use the standard MDDeployMain dialog (also shown in the database installer sample) where there is a screen that let's the user enter any name they would like.  But in either case, you can change the name to be whatever you like.  The DatabaseMigrator class accepts an array with all of the names that will be deployed to...so it then just becomes a matter of you asking the end-user for the name at some point prior to the DDR deployment.

2. I have some view that join tables from local and remote database. The remote database name could be vary among customer even though it is has the same structure. How could I tell DDT at runtime so that it will "change" my view defination to map to the remote database?

One thing you may consider here is using the Pre/Post Deployment Scripts.  You can implement any logic you need within this scripts.  This might be a good example of where you would want to do this.  Let the DDT deploy as it would normally, then in a post deployment script, you could execute some script that updates the view to whichever remote database you need.  That would be one way of doing this.

Chan
Chan
Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)
Group: Forum Members
Posts: 533, Visits: 2K
Hi,

I have questions as below:



1. How could I allow user to decide database name during DDT deployment?

2. I have some view that join tables from local and remote database. The remote database name could be vary among customer even though it is has the same structure. How could I tell DDT at runtime so that it will "change" my view defination to map to the remote database?



Please advice.



Thank you
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