Print Page | Close Window

Connection String and Environments

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce Classic
Forum Discription: For .NET 2.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=549
Printed Date: 11-Jun-2026 at 5:22am


Topic: Connection String and Environments
Posted By: Makani
Subject: Connection String and Environments
Date Posted: 15-Nov-2007 at 8:58am
My application currently is two tiers with a Windows client deployed through ClickOnce connecting directly to the database.  I am wondering how to manage connection strings during deployment to different environments and have a couple of questions.
 
Currently the connection string is an embedded resource within the AppHelper assembly.  Is it possible to extract embedded text file from a dll.  Should I encrypt that resource?
 
If I leave the file unencrypted and as an embedded resource how can I allow an administrator to modify the connection string to the appropriat environment.?  Custom config app that builds the AppHelper.dll or maybe just have the admin use the .net compiler, MSBuild? Anyone have code or an example.
 
Thanks,
Mike
 
 
 



Replies:
Posted By: davidklitzke
Date Posted: 15-Nov-2007 at 11:49am
To solve your problem go to the documentation and read about Data Source Keys and the DataSourceKeyResolver.  Instead of using an embbeded (or loose) ibconfig file which contains a static string, you will define a method which will retrieve a connection string.  You can be as resourceful as you want in this method.  The connection string may be embedded in a file or be imported from a Web Service or database.  You can decide to use or not to use encryption.



Print Page | Close Window