Help on configuration file ???

G

Guest

Dear all,

I am building an ASP 1.1 application based on a n-Tier architecture.
I have my datalayer class that need to read the connection string of my sql
server database from a configuration file as it can be located anywhere.

Do I have to add a web.config file within my class library project and call
my AppSetting section with standard .Net function or do I have to do it in an
other way around ?

In other words, can I get as many web.config file as I have class library in
different location if needed?

regards
serge
 
D

DavidG

web.config does not apply to class library projects, I normally
retrieve the string from web.config in my web services project and
pass it as a parameter to my data layer

HTH

David
 
I

intrader

Dear all,

I am building an ASP 1.1 application based on a n-Tier architecture.
I have my datalayer class that need to read the connection string of my sql
server database from a configuration file as it can be located anywhere.

Do I have to add a web.config file within my class library project and call
my AppSetting section with standard .Net function or do I have to do it in an
other way around ?

In other words, can I get as many web.config file as I have class library in
different location if needed?

regards
serge
You may also look into 'Configuration Application Block' for guidance.
http://msdn.microsoft.com/library/en-us/dnpag2/html/config.asp
 
G

Guest

Yeha, this is what I usually done when I build windows application
But here I was wondering how my datalayer single class located on a Server A
can access to web.config file located at the root of my application on a
server B ?

To better understand, I have basic application function where web.config is
located on the root of the application when installing it. SO far so good.

Then I have a Web service which is instanciate the datalayer class to get
data from SQL. In order that the web service instanciate properly the
datalayer class, this class need to be at the same location as the web
service.

Here comes the problem for my datalayer to point correctly to the SQL server
?
What would be the solution

regards
serge
 
K

Karl Seguin [MVP]

If i understand correctly, your web application communicates with the data
layer via a web service. It's the web service which needs to have the
configuration data. Wouldn't you simply include the configuration data
within the web.config of your web service?

Karl
 
G

Guest

Yes, this si the way I was thinking of, but I was wondering if its the
correwct way to do
thnaks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,175
Latest member
Vinay Kumar_ Nevatia
Top