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 7 1510
Well, the way i do it is to have a single web.config and multiple
configuration sections. You can see a write up on it at: http://codeproject.com/aspnet/KarlSegCustomConfig.asp
Karl
--
MY ASP.Net tutorials http://www.openmymind.net/
"serge calderara" <se************@discussions.microsoft.com> wrote in
message news:6C**********************************@microsof t.com... 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
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
On Thu, 12 Jan 2006 07:51:09 -0800, serge calderara wrote: 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...tml/config.asp
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
"Karl Seguin [MVP]" wrote: Well, the way i do it is to have a single web.config and multiple configuration sections. You can see a write up on it at: http://codeproject.com/aspnet/KarlSegCustomConfig.asp
Karl
-- MY ASP.Net tutorials http://www.openmymind.net/
"serge calderara" <se************@discussions.microsoft.com> wrote in message news:6C**********************************@microsof t.com... 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
Good, this is exactly whet I need
thanks
"DavidG" wrote: 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
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
--
MY ASP.Net tutorials http://www.openmymind.net/
"serge calderara" <se************@discussions.microsoft.com> wrote in
message news:F1**********************************@microsof t.com... 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
"Karl Seguin [MVP]" wrote:
Well, the way i do it is to have a single web.config and multiple configuration sections. You can see a write up on it at: http://codeproject.com/aspnet/KarlSegCustomConfig.asp
Karl
-- MY ASP.Net tutorials http://www.openmymind.net/
"serge calderara" <se************@discussions.microsoft.com> wrote in message news:6C**********************************@microsof t.com... > 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
Yes, this si the way I was thinking of, but I was wondering if its the
correwct way to do
thnaks
"Karl Seguin [MVP]" wrote: 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
-- MY ASP.Net tutorials http://www.openmymind.net/
"serge calderara" <se************@discussions.microsoft.com> wrote in message news:F1**********************************@microsof t.com... 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
"Karl Seguin [MVP]" wrote:
Well, the way i do it is to have a single web.config and multiple configuration sections. You can see a write up on it at: http://codeproject.com/aspnet/KarlSegCustomConfig.asp
Karl
-- MY ASP.Net tutorials http://www.openmymind.net/
"serge calderara" <se************@discussions.microsoft.com> wrote in message news:6C**********************************@microsof t.com... > 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 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: serge calderara |
last post by:
dear all,
I have problem accessing section group in my configuration
application file. I got an error saying thta I can have
only one section ????
here is my application configuration looks...
|
by: Tree menu using XML |
last post by:
I have one XML file that has nodes and sub node and each and every node has
the attribute call visible if its value is true then diplay this node else
don't display thid node, but this condition i...
|
by: baustin75 |
last post by:
Posted: Mon Oct 03, 2005 1:41 pm Post subject: cannot mail() in ie
only when debugging in php designer 2005
--------------------------------------------------------------------------------
...
|
by: David Elliott |
last post by:
I am creating a configuration class to read / write a standard configuration file.
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<appSettings>
<add key="ConnectionString"...
|
by: Kevin Farless |
last post by:
Hi all,
I'm having trouble viewing any .aspx pages on my hosting company's server.
The server is a new box running Windows Server 2003 default installation.
I'm the first client to try using...
|
by: Kamal Dhingra |
last post by:
Hi Guys,
I am developing an asp.net application .In error handling , I have 2 web.congif files ,one is in Web(which is the virtual directory) ,other i have created in a folder in Web/Admin. The...
|
by: James Radke |
last post by:
Hello,
I have a multithreaded windows NT service application (vb.net 2003) that I
am working on (my first one), which reads a message queue and creates
multiple threads to perform the processing...
|
by: Sai |
last post by:
Hi,
I am using VSTO 2005 Beta for building an excel application. I added
application configuration file to the project (app.config) and it has the
following section in it.
<configuration>...
|
by: treelife |
last post by:
I'm getting and internal server error when | run the following
mod_python script. I am actually trying to run Django.
Script:
from mod_python import apache
def handler(req):...
|
by: =?Utf-8?B?ZGdvdw==?= |
last post by:
I designed a "contact_us" page in visual web developer 2005 express along
with EW2 after viewing tutorials on asp.net's help page. Features work like
they should, but I cannot figure out how to...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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...
|
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...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
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: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |