StrataFrame Forum

Database Connection Wizard Problem

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

By Clayton Hoyt - 9/28/2006

Hi Folks

I am an sysadmin on my laptop to my SQL2005 default instance but when I try to use the Database Connection Wizard, the Database droplist is disabled and only shows Strataframe as the database. I also tried this with the SA account without success.  How can I get this list enabled?

Clay

By Trent L. Taylor - 9/28/2006

You can't.  The data source connection you are trying to change is the StrataFrame Data Store connection.  We prevent this from being changed because this is that StrataFarme connection, not the connection associated with your application.  You specify the connection for your appliction the the SetDataSources method in a WinForm app or you can just manually specify the connection:

MicroFour.StrataFrame.Data.Databasics.DataSources.Add(New SqlDbDataSourceItem("","YourConnectionString"))

If you use the connection wizard, you will use the AddrequiredDataSourceItem and the SetConnections in the SetDataSources method of the AppMain.vb or program.cs file.

By Daniel Essin - 5/13/2007

Followup question:



If I use the Database Connection menu item in VS and choose new, the database dropdown is still grayed out and unavailable. I understand how to do it in code.



Under what circumstances would you use the Database Connection dialog to add a database and is the database list ever enabled when you are in design mode in VS?



Thank you
By Trent L. Taylor - 5/14/2007

The reason this is grayed out through the Visual Studio environment is to avoid the question you would ask next if you changed this value to something other than StrataFrame.  StrataFrame uses the Connection String Wizard as well and if you change this to YOUR database then it would not work.  This is the connection to the StrataFrame database which is used through the framework....NOT your connection to your application at run-time.  Your connection string should be assigned in the AppMain.vb or program.cs file in teh SetDatabases method.
By Daniel Essin - 5/14/2007

I thought that might be the answer. If I'm handling the connections in the startup code, I'm not clear then about when I would want to use the Database Connection menu item or for what.



Thanks
By Trent L. Taylor - 5/14/2007

The menu item in Visual Studio is STRICTLY for setting a connection the StrataFrame database and is used to house BO Mappings, Role-Based Security projects, DDT projects, etc.  The connection for your application will be defined in the AppMain.vb or program.cs file in the SetDatabases() method.  I recommend looking at the docs on this and even look at the samples as they all use the Connection String Manager and call SetConnections().  If you are going to setup the connection string yourself, then look in the docs for the DataSources collection and manually specify the connection yourself.
By Daniel Essin - 5/14/2007

Thanks for clarifying that. I have been setting connections in code and that works fine. For some reason I got the notion that the dialog might be there for a more general purpose but I understand now that it is not.