473,796 Members | 2,609 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Why have the difference between web.config and app.config

ad
When I add a connection string by wizard in a WebApp , the wizard add the
connection string to web.config like
<add name="MyDataBas e" connectionStrin g="Data Source=.\SQLEXP RESS;Initial
Catalog=xxxx;.. ...

But if I add the same connection string by wizard in a class library
project, the connection string in app.config will be:
<add name="dataHealt h.Properties.Se ttings.MyDataBa se"
connectionStrin g="Data Source=.\SLEEPE RS;Initial Catalog=xxxx...

The connection string name in app.config will be initial with
"ProjectName..P roperties.Setti ngs"
Why have the difference between web.config and app.config

Mar 28 '06 #1
1 2182
For a web application, you would use web.config. For either an EXE or class
library DLL, you would use the "app".confi g. The difference with the
connection string name is so that you can maintain uniqueness among multiple
config files. Also, the web.config can be accessed from either
System.Configur ation.Configura tionManager or
System.Web.Conf iguration.WebCo nfigurationMana ger.

I'm not sure if this is what you're looking for.
--
Christopher A. Reed
"The oxen are slow, but the earth is patient."

"ad" <fl****@wfes.tc c.edu.tw> wrote in message
news:u$******** ******@TK2MSFTN GP14.phx.gbl...
When I add a connection string by wizard in a WebApp , the wizard add the
connection string to web.config like
<add name="MyDataBas e" connectionStrin g="Data Source=.\SQLEXP RESS;Initial
Catalog=xxxx;.. ...

But if I add the same connection string by wizard in a class library
project, the connection string in app.config will be:
<add name="dataHealt h.Properties.Se ttings.MyDataBa se"
connectionStrin g="Data Source=.\SLEEPE RS;Initial Catalog=xxxx...

The connection string name in app.config will be initial with
"ProjectName..P roperties.Setti ngs"
Why have the difference between web.config and app.config

Mar 30 '06 #2

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

Similar topics

5
3540
by: Neil Rutherford | last post by:
During testing of an application, i noticed a difference between SQL 2000 and SQL 7, both with identical config. In a nutshell: A table has a trigger for UPDATE and DELETE. When a column in the table is UPDATED the following happens: In autocommit mode, when entering a trigger the trancount equals 1 for both SQL 7 and 2000.
2
2017
by: TS | last post by:
In these 2 snippets, "user" references 2 different things in my app: ------------------------------------------------- Dim ident As System.Security.Principal.WindowsIdentity = System.Security.Principal.WindowsIdentity.GetCurrent() Dim User As New System.Security.Principal.WindowsPrincipal(ident) & HttpContext.Current.User -------------------------------------------------
1
2845
by: herbert | last post by:
In VS.2005 there are three templates for storing application info: Resource File Settings File Application File. 1) What is the purpose of each one? When to use, when not? 2) How does VB's My.Setting map to these files? 3) Can a C# application access data written by VB's My.Setting ? 4) How does the ConfigurationManager class map to these files and is it relevant to VB.Net coders?
4
14153
by: SandyIsCool | last post by:
Hi, Can any one let me know what is difference between Server.mappath and Page.resolveURL and what are the situations we use them. Thanks, Sandy
2
7320
by: Beemer Biker | last post by:
I have some demo code that came with a 3rd party product. This is what it looks like (I remove html braces in case it does not print right) Register TagPrefix="pin" Namespace="Pintexx.Components.Web.pinTab" Assembly="pinTab" That line of code was the 2nd line just below the Page Language="C#" ... in default.aspx I created a new, blank page, and attempted to copy and paste the control
4
5062
by: Dan | last post by:
Hi, i'm not sure to understand the difference between refreshing the pagina by clicking on 'refresh' in the browser and a postback. What i think it is: Suppose a page with a form containing a textbox and a dropdowlist: and a button to start something n code-behind: a refresh doesn't send any value back to the server but with a postback, the values are sent? But then, which role does Viewstate play in the postback proces?
1
939
by: venkatappareddy | last post by:
wt is the difference between system.config and wed.config
9
3042
by: msbs1984 | last post by:
Difference Between Interface and Abstract Class?
5
3011
by: daveh551 | last post by:
What, from a high level point of view, is the difference (in Visual Studio 2005) between Website (accessed with Open Website or Create Website from the StartPage) that is an ASP.NET Website, and a Project that is created with the "ASP.NET Application" template? I see some obvious differences: the Project creates the working folder under the Visual Studio 2005\Projects directory, while the Website creates it in the Inetpub\wwwroot...
0
10465
Oralloy
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10242
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10200
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10021
tracyyun
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9061
agi2029
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7558
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6800
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4127
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3744
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.