473,378 Members | 1,413 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,378 software developers and data experts.

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="MyDataBase" connectionString="Data Source=.\SQLEXPRESS;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="dataHealth.Properties.Settings.MyDataBase"
connectionString="Data Source=.\SLEEPERS;Initial Catalog=xxxx...

The connection string name in app.config will be initial with
"ProjectName..Properties.Settings"
Why have the difference between web.config and app.config

Mar 28 '06 #1
1 2166
For a web application, you would use web.config. For either an EXE or class
library DLL, you would use the "app".config. 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.Configuration.ConfigurationManager or
System.Web.Configuration.WebConfigurationManager.

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.tcc.edu.tw> wrote in message
news:u$**************@TK2MSFTNGP14.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="MyDataBase" connectionString="Data Source=.\SQLEXPRESS;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="dataHealth.Properties.Settings.MyDataBase"
connectionString="Data Source=.\SLEEPERS;Initial Catalog=xxxx...

The connection string name in app.config will be initial with
"ProjectName..Properties.Settings"
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
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...
2
by: TS | last post by:
In these 2 snippets, "user" references 2 different things in my app: ------------------------------------------------- Dim ident As System.Security.Principal.WindowsIdentity =...
1
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...
4
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
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"...
4
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...
1
by: venkatappareddy | last post by:
wt is the difference between system.config and wed.config
9
by: msbs1984 | last post by:
Difference Between Interface and Abstract Class?
5
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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?

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.