Command line generator : dynamic connection string

Posts   
 
    
TommyKeane
User
Posts: 8
Joined: 07-May-2006
# Posted on: 07-May-2006 13:18:49   

Hi,

I am currently implementing an automated build process and am trying to integrate an automated code generation step using LLBLGEN.

Our database is generated from scratch each time the build is run and it will have a unique name for each build too.

Is there a way to provide a dynamic connection string to either the command line generator or the command line refresher?

Thanks, Tommy

sparmar2000 avatar
Posts: 341
Joined: 30-Nov-2003
# Posted on: 07-May-2006 19:29:30   

Tommy I think these util will need to be enhanced. You have access to the source code for both these and thus the opertunity to customise it to fit in very well with the build process you are in the process of implementing.

The connection string normally 'sit' in the config file, therefore you will need a function to over write it and the startup.cs to accept the additional param.

TommyKeane
User
Posts: 8
Joined: 07-May-2006
# Posted on: 07-May-2006 23:45:57   

sparmar2000 wrote:

Tommy The connection string normally 'sit' in the config file, therefore you will need a function to over write it and the startup.cs to accept the additional param.

Thanks, I'll do that so.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39928
Joined: 17-Aug-2003
# Posted on: 09-May-2006 08:37:47   

Only the refresher uses a connection string, and by default it reads it from the project. You can overwrite any value in the project in the refresher startup code as Suresh suggested, so I'd look in that direction. simple_smile The code generator doesn't use a connection string.

Frans Bouma | Lead developer LLBLGen Pro
TommyKeane
User
Posts: 8
Joined: 07-May-2006
# Posted on: 13-May-2006 14:50:39   

Otis wrote:

Only the refresher uses a connection string, and by default it reads it from the project. You can overwrite any value in the project in the refresher startup code as Suresh suggested, so I'd look in that direction. simple_smile The code generator doesn't use a connection string.

I have modified the refresher to change the projectToRefresh.ConnectionString property to a new connection string.

Although this property is changed and is persisted in the .lgp file (I can output it to the console when the refresher is run a second time), the entities do not reflect any changes. When I open the refreshed project in LLBLGEN UI and refresh the catalog, the old server name is listed in the Database connection information section.

Is there another setting which I should be modifying in the SD.LLBLGen.Pro.ApplicationCore.Project class?

Thanks, Tommy

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39928
Joined: 17-Aug-2003
# Posted on: 16-May-2006 11:06:35   

Yes, you should modify project.ConnectionElements. It's a hashtable. As keys, values from the enum DBDriverCore.ConnectionElement are used, values depend on what you've specified in the connection control when creating/refreshing the project in llblgenpro.

Use the project inspector tool to check the current contents of that hashtable to make the proper changes simple_smile

Frans Bouma | Lead developer LLBLGen Pro