StrataFrame Forum

Business objects and databases (An easy question ;-)

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

By Ben Kim - 11/8/2006

New to StrataFrame.

We are generating objects using the DB deployment toolkit, Business object component class and the Business Object Mapper.

It appears what is generated for the DB name is our development database name.  When deployed is this overridden by what the user specifies as his/her database name?  Or do we need to write code to override?

Ben

By Trent L. Taylor - 11/8/2006

At the moment this would require you to write some code to redirect the database to a different name...however, this is something that has been requested more than once (the ability to have a dynamic database name).
By David Farrell-Garcia - 11/9/2006

In our application, we need to give the user the capabilty of creating additional databases so that they can manage several companies.  What would be the suggested steps for doing that?
By Trent L. Taylor - 11/9/2006

The only thing that has to change is the connection string.  The database is not hard coded into the business objects.  So if you create another database, all that you need to take into account is your connection string...or more than likely, just the database portion of the connection string.

Here is an idea of what you could do after your standard connections have already been established:

       

Dim loConnection As New Data.SqlClient.SqlConnectionStringBuilder(MicroFour.StrataFrame.Data.DataBasics.DataSources(0).ConnectionString)

loConnection.DataSource = "MyNewDatabase"

MicroFour.StrataFrame.Data.DataBasics.DataSources(0).ConnectionString = loConnection.ToString()