StrataFrame Forum

Shared Settings File predefined by bypass Connection Wizard

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

By Govinda Berrio - 12/10/2012

Hi, 

does anyone know if there is a way to "pass in" the location of the Shared Settings File without firing up the Connection Wizard. 

What I would like to happen is deploy an app with the location of the SSF embedded, and bypass the connection wizard completely. The user would just install the application, run it and it would apply the DB connections automatically without being prompted. The next prompt after starting the app would be the login.

Thank You,
Govinda
By Trent L. Taylor - 12/10/2012

Govinda:

At the moment there isn't.  However, this only has to be done once.  This is a good idea, though.  I will look at the source and see how much energy would be involved.
By Govinda Berrio - 12/11/2012

Thanks Trent
By Govinda Berrio - 12/12/2012

Trent, 

we are going to try modifying the SF source to add this functionality until you guys can implement it in the SF product. 

Can you give me a place to start with this? A class name where it would make sense to add this functionality to, perhaps?
Or the method that loads the SSF and writes the connection files to the user profile?

Thank You,
Govinda 
By Trent L. Taylor - 12/12/2012

Govinda:

If you wanted to, you could just load a DbeSharedSettingsData and then create the connection yourself.  It would look something like this:

DbeSharedSettingsData sharedSettings = new DbeSharedSettingsData();

//-- Load the shared settings file into the BO.  The shared settings file is XML that populates a business object.
sharedSettings.FillWithSharedSettings(@"c:\Repository\NameOfSharedSettingsFile.ssf");

//-- Build a connection string
string connectionString = "server=" + sharedSettings.ss_server + ";";

if(sharedSettings.ss_windowsauthentication)
    connectionString += "integrated security=SSPI;";
else
    connectionString += "user=" + sharedSettings.ss_username + ";password=" + sharedSettings.ss_password + ";"

connectionString += "database=" + sharedSettings.ss_initialcatalog + ";";

//-- Now you can create your connection
MicroFour.StrataFrame.Data.DataBasics.DataSources.Add(New SqlDataSourceItem(string.Empty,connectionString));



You may have to tweak the above code, I just typed it in here in the forum editor, so it may have a small typo here or there, but this should get you going without changed the SF source.
By Govinda Berrio - 12/20/2012

Trent, 

this looks like exactly what we are looking for.

Thank You!
By Trent L. Taylor - 12/20/2012

Cool.  Glad it helped. Smile