Question about connections


Author
Message
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (4.8K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
I'm very new to this (using the trial edition, v1.5) and have a question about connections. I would like to connect to different databases (dev, test, prod, etc.) so the connection manager is very nice for this. However, I also would like to a single logon to the database, then use the security module to authenticate users, etc. and NOT have them authenticate directly against SQL Server.



I.e. I would like to use a normal web app like system, the app can connect, via a known, but secure username and password to SQL Server, the users authenticate against a table or Windows (less likely) to get access to the app. I would like to use this in both WinForm and WebForm apps.



I see that the Web sample is using the DataLayer.DataSources.Add, while the WinForms use ConnectionManager.AddRequiredDataSourceItem. What's the difference?



Also, what are your suggestions for storing the connection information (username, password especially) for a WinForm or WebForm app? How to change easily? Any way to allow users to change? (Mainly for testers).



Thanks!

Greg
Replies
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (4.8K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
OK, it's making more sense. I guess the next thing I need to know is how to clear existing settings for an app, so I can test it. I.e. how do I clear the current settings so the connection manager appears? Also, is any of this related to the New Profile/Open Profile items on the File menu of the standard StrataFrame application (MDI)?



Thanks for your continued help! You folks have been great!
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: 7K
how do I clear the current settings so the connection manager appears?

Option 1
All of the connection settings are stored in an external encrypted file which you can just delete and when you re-run your application the wizard will automatially appear.  These files are located in the following location:

C:\Documents and Settings\All Users\Application Data\MicroFour\ConnectionData

There are two files, the AppKeys.dat and the Connections.dat.  If you delete these any StrataFrame application that uses the Connection String Wizard will automatically show the wizard the next time the app is run...just FYI this includes StrataFrame itself on your development machine since StrataFrame uses itself Smile

Option 2
Change your application key within the AppMain.vb or program.cs file depending upon your language.  You will find this in the SetDataSources() method.  Since all automated connection strings are stored using this application key as the unique identifier, changing this will force the wizard to re-appear since it will not be able to locate an active connection string for this key.

ConnectionManager.ApplicationKey = "ChangeThisValue"

Option 3
Probably your best bet on most occasions is to just edit the connection through the wizard.  This same editor allows you to have more than one set of connection strings per application.  For example, you can bounce between your development server, testing server, and production server without ever getting out of the application itself.  To show this window and add a new connection or edit an existing one, call the following method:

ConnectionManager.ShowAvailableConnectionStrings()

You can find more details on this in the docs, but this should get you going.

Also, is any of this related to the New Profile/Open Profile items on the File menu of the standard StrataFrame application (MDI)?

Yes, if you created a StrataFrame Main Form, this template already has the Database Connection menu item that basically performs the Option 3 specified above.

Thanks for your continued help! You folks have been great!

Thanks! Smile  We're glad to help.

Greg McGuffey
Greg McGuffey
Strategic Support Team Member (4.8K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
OK, thanks for the infor on clearing connections.



One last bit of clarification. What are the Open Profile/New Profile items in the File menu supposed to be used for? There is no code and there is already a Database Connection item.
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: 7K
Oh...you can just delete those or change the names to whatever you would like.  It is just there as a place marker and serves no purpose.  We just had those as menu items when we created the template...so you can disregard those...sorry for the confusion. 

Then only menu item that is functional in that template is the Database Connection...

Greg McGuffey
Greg McGuffey
Strategic Support Team Member (4.8K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
OK, thanks for all the information. I'm sure you'll be hearing from me again. BigGrin
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: 7K
Great Smile !  Feel free to post anytime!!!
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View
Threaded View
Greg McGuffey - 19 Years Ago
StrataFrame Team - 19 Years Ago
Greg McGuffey - 19 Years Ago
Trent L. Taylor - 19 Years Ago
Greg McGuffey - 19 Years Ago
                         [quote]how do I clear the current settings so the connection manager...
Trent L. Taylor - 19 Years Ago
                             OK, thanks for the infor on clearing connections.

One last...
Greg McGuffey - 19 Years Ago
                                 Oh...you can just delete those or change the names to whatever you...
Trent L. Taylor - 19 Years Ago
                                     OK, thanks for all the information. I'm sure you'll be hearing from me...
Greg McGuffey - 19 Years Ago
                                         Great :) ! Feel free to post anytime!!!
Trent L. Taylor - 19 Years Ago

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search