473,385 Members | 1,863 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

web.config parameters inside compiled ClassLibrary

Hi folks,

I've created a class library, compiled as a .DLL-file to support my
ASP.NET webapplication. My .NET-application has some parameters (ie.
SQL connection string) stored in the web.config file. But I havent't
been able yet to use these parameters inside the class library ?

ConfigurationSettings.AppSettings() is not recognized, so I can't
compile the DLL with it...

Is it possible to retrieve these parameters from web.config from
inside a class library ?
Thx in advance!
Kind regards
Mathew

May 18 '07 #1
1 1339
KJ
You may just need to Add Reference to System.Configuration in the class
library, and then use the ConfigurationManager.AppSettings syntax.

"Lupus" <ma**********@gmail.comwrote in message
news:11**********************@q75g2000hsh.googlegr oups.com...
Hi folks,

I've created a class library, compiled as a .DLL-file to support my
ASP.NET webapplication. My .NET-application has some parameters (ie.
SQL connection string) stored in the web.config file. But I havent't
been able yet to use these parameters inside the class library ?

ConfigurationSettings.AppSettings() is not recognized, so I can't
compile the DLL with it...

Is it possible to retrieve these parameters from web.config from
inside a class library ?
Thx in advance!
Kind regards
Mathew


May 18 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: policywatcher | last post by:
So I've been really good. I've written my nice shiny new app to use a ..config file. I have code that is nicely reading (and updating as required) the settings in the .config file, and the app...
6
by: Bonj | last post by:
Like a web app can store its connection string in the web.config file, can a windows forms or console app or windows service store its connection string in app.config? Is it advisable? I know...
7
by: A.M-SG | last post by:
Hi, We have a class library application that needs to read some application settings from it's own app.config file. I assume that a ClassLibrary.DLL can have a app.config file, but...
3
by: Christopher Kimbell | last post by:
I have a class library that contains a number of TableAdapters and I'm using this from a web application. Is there a way of getting the TableAdapters to use the connectionstrings defined in...
5
by: Sridhar | last post by:
Hi, I have created a project which contains classes to read the data from the database. This project has an App.Config file which contains the SqlConnection String. when this code is called from...
7
by: Stefan | last post by:
Hi! I´m creating a classlibrary project. The output will be a dll. This dll will have to read some settings from some kind of config-file. Normally, when creating a standard .exe-program I use...
0
by: ad | last post by:
I have a ClassLibrary project, there are app.config and settings.settings in it. I add a connections with DataAdapter wizard in the app.config, the settings.settings also receive the connection...
5
by: ad | last post by:
I am developing web applicaiton with VS2005. The WebApp used a ClassLibrary in another project. There are some TableAdapter in the classlibrary, and the TableAdapter use the connection in the...
1
by: huntco | last post by:
VS2005, .Net 2.x I've built a .dll from the classlibrary template. Everything works great on the development box. When moving it over to the production box, I started getting database connection...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.