Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Connection String in app.config

Reply
Thread Tools

Connection String in app.config

 
 
Fresno Bob
Guest
Posts: n/a
 
      01-24-2008
I am creating data access layer with strongly typed datasets in a class
library included in a Website Project. My website uses a web.config file to
store the connection string but the class uses the app.config.

When I deploy my application is there any way of changing the app config
without recompiling the application. I have never done this before so I am
not sure how it works.

Regards, Chris.


 
Reply With Quote
 
 
 
 
Scott Roberts
Guest
Posts: n/a
 
      01-24-2008

"Fresno Bob" <(E-Mail Removed)> wrote in message
news:u$(E-Mail Removed)...
>I am creating data access layer with strongly typed datasets in a class
>library included in a Website Project. My website uses a web.config file to
>store the connection string but the class uses the app.config.


What do you mean by "the class uses the app.config"? If you are using
ConfigurationManager.ConnectionStrings in your class, then it will use the
config file specified by the application (web.config for a web project, or
app.config for an application). You don't have to do anything special.

 
Reply With Quote
 
 
 
 
Jeff Dillon
Guest
Posts: n/a
 
      01-24-2008
Use Notepad to change the app.config. It's read at run time

Jeff

"Fresno Bob" <(E-Mail Removed)> wrote in message
news:u$(E-Mail Removed)...
>I am creating data access layer with strongly typed datasets in a class
>library included in a Website Project. My website uses a web.config file to
>store the connection string but the class uses the app.config.
>
> When I deploy my application is there any way of changing the app config
> without recompiling the application. I have never done this before so I am
> not sure how it works.
>
> Regards, Chris.
>



 
Reply With Quote
 
Fresno Bob
Guest
Posts: n/a
 
      01-25-2008
I have a website website in my solution as well as two class libraries, one
for my business layer and one for my data access layer. The DAL is made up
of strongly typed datasets using the app config to get the connection
string.

I have added references within my website to the BLL and DAL projects so
when I compile the project they get added to the bin of the website. I can't
see a way of changing the app.config whithin my website as it doesn't get
added the website on compilation. I am sure there must be a way of changing
it at run time I just can't see how.

Regards, Chris.



"Jeff Dillon" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Use Notepad to change the app.config. It's read at run time
>
> Jeff
>
> "Fresno Bob" <(E-Mail Removed)> wrote in message
> news:u$(E-Mail Removed)...
>>I am creating data access layer with strongly typed datasets in a class
>>library included in a Website Project. My website uses a web.config file
>>to store the connection string but the class uses the app.config.
>>
>> When I deploy my application is there any way of changing the app config
>> without recompiling the application. I have never done this before so I
>> am not sure how it works.
>>
>> Regards, Chris.
>>

>
>



 
Reply With Quote
 
Scott Roberts
Guest
Posts: n/a
 
      01-25-2008
Bob,

What makes you think that the DAL is using app.config to get the connection
string? Have you tried simply putting the connection string into web.config?


"Fresno Bob" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I have a website website in my solution as well as two class libraries, one
>for my business layer and one for my data access layer. The DAL is made up
>of strongly typed datasets using the app config to get the connection
>string.
>
> I have added references within my website to the BLL and DAL projects so
> when I compile the project they get added to the bin of the website. I
> can't see a way of changing the app.config whithin my website as it
> doesn't get added the website on compilation. I am sure there must be a
> way of changing it at run time I just can't see how.



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to set the connection pool size in the Sybase connection string? Wei Lu ASP .Net 2 02-16-2009 09:51 AM
Web.config: connection string or connection key? rlueneberg@gmail.com ASP .Net 3 08-03-2007 09:37 PM
Connection String object Convert to String Variable Type =?Utf-8?B?TWlrZSBNb29yZQ==?= ASP .Net 2 10-26-2004 02:43 PM
Re: String.replaceAll(String regex, String replacement) question Mladen Adamovic Java 0 12-04-2003 04:40 PM
connection string exception : Format of the initialization string does not conform to specification starting at index 0 Gaurav ASP .Net 0 11-07-2003 10:24 AM



Advertisments