« Return to Thread: Class Library DB Connection String

Re: Class Library DB Connection String

by James Crossley :: Rate this Message:

Reply (Restricted by the Administrator) | View in Thread

Some parts of this message have been removed. Learn more about Nabble's security policy.

Hi Adam

 

I can’t answer that but suggest you try in a more general .net or linq forum.  You’ll reach a broader audience.

 

HTH
James

 

From: fluorine-bounces@... [mailto:fluorine-bounces@...] On Behalf Of Adam Schaible
Sent: Wednesday, 1 June 2011 01:06
To: Fluorine Mailing List
Subject: Re: [Fluorine] Class Library DB Connection String

 

Yes I can do this but I’m not familiar with any .net friendly way to do this.

 

I know I could re-arrange the code to actually go to the config file and read from it - but I was hoping to use the built-in config patterns.  For example, if I’m using linq in my class library, it puts the connection string in app.config – but when I build the website project, it just compiles the connection string into the dll.

 

Since all of the linq connection object creation is in generated code, I’d rather not modify that --- or are you describing a way I can do that?

 

Thanks

 

From: fluorine-bounces@... [mailto:fluorine-bounces@...] On Behalf Of James Crossley
Sent: Tuesday, May 31, 2011 2:41 AM
To: Fluorine Mailing List
Subject: Re: [Fluorine] Class Library DB Connection String

 

Hi Adam

 

We store our database connection string in web.config in the bin folder.  Our server-side code reads it from there.  Can’t you do this?

 

HTH

James

 

 

From: fluorine-bounces@... [mailto:fluorine-bounces@...] On Behalf Of Adam Schaible
Sent: Tuesday, 31 May 2011 15:33
To: Fluorine Mailing List
Subject: [Fluorine] Class Library DB Connection String

 

Hi guys,

 

Been using Fluorine for quite some time now – but I’ve never really fixed this issue and it’s bugged me for a while.

 

So if we create a fluorine class library, then add a web site and build the project, our class library contains all of the database stuff.  If we have different deployment environments it can get very tedious trying to change the connection strings around.  Is there a way for me to get the web site project to use the app.config file for the dll – or is there another recommended way to handle this?

 

Thanks in advance


______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________


_______________________________________________
fluorine mailing list
fluorine@...
http://fluorine.thesilentgroup.com/mailman/listinfo/fluorine_fluorine.thesilentgroup.com

 « Return to Thread: Class Library DB Connection String