473,569 Members | 2,412 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Entering new entry in Web.config produces app error

Hello, I'm new with ASP.NET.

I've seen samples which has custom 'entry' in Web.Config which works well.
But when I enter my 'entry', it produces app error:

The entry is like below:-

<?xml version="1.0" encoding="utf-8" ?>
<configuratio n>
<myAspApp>
<database>
<add key="connection String" value="Server=s qlserver; uid=sa;
pwd=1234; database=testDB " />
</database>
</myAspApp>

<system.web>
Nov 18 '05 #1
3 1383
You've got to use the correct keywords and syntax. You can't make up your
own hierarchy like that. You'll want something like this:

<appSettings>
<add key="Applicatio n1" value="MyApplic ation1" />
<add key="Setting1" value="MySettin g" />
</appSettings>

See the hierarchy here:

http://msdn.microsoft.com/library/de...ionsschema.asp

Ken
"Razak" <ra***@mmsc.com .my> wrote in message
news:Or******** ******@TK2MSFTN GP12.phx.gbl...
Hello, I'm new with ASP.NET.

I've seen samples which has custom 'entry' in Web.Config which works well.
But when I enter my 'entry', it produces app error:

The entry is like below:-

<?xml version="1.0" encoding="utf-8" ?>
<configuratio n>
<myAspApp>
<database>
<add key="connection String" value="Server=s qlserver; uid=sa;
pwd=1234; database=testDB " />
</database>
</myAspApp>

<system.web>
.
.
.
</system.web>
</configuration>
Why doesn't it work for me whereas the samples implement the same method
for
configuring its app db connection?

Please help. Thanks.

----------------------------------------------------------------------------
---- -----------------------------------------------------------------------
---------


Nov 18 '05 #2
yes.. I just found out that's one way of doing it... but I checked on a
sample project by ASP.NET Community Stater kit and they config their
application like this..

<configuratio n>
<configSections >
<sectionGroup name="community StarterKit">
<section name="Isp"
type="ASPNET.St arterKit.Commun ities.Communiti esSectionHandle r,ASPNET.Starte r
Kit.Communities " />
<section name="pagePaths "
type="ASPNET.St arterKit.Commun ities.Communiti esSectionHandle r,ASPNET.Starte r
Kit.Communities " />
<section name="database"
type="ASPNET.St arterKit.Commun ities.Communiti esSectionHandle r,ASPNET.Starte r
Kit.Communities " />
<section name="services"
type="ASPNET.St arterKit.Commun ities.Communiti esSectionHandle r,ASPNET.Starte r
Kit.Communities " />
</sectionGroup>
</configSections>

<communityStart erKit>
<Isp>
<add key="IspUsernam e" value="admin" />
<add key="IspPasswor d" value="a1854928 " />
</Isp>

<pagePaths>
<add key="basePage" value="/communityDefaul t.aspx" />
<add key="baseServic e" value="/communityServic e.asmx" />
</pagePaths>

<database>
<add key="connection String"
value="server=l ocalhost;uid=sa ;pwd=secret;dat abase=community StarterKitNEW"
/>
</database>

<services>
<add key="enableServ iceTimer" value="true" />
</services>
</communityStarte rKit>
<system.web>
<compilation debug="false" />
......

I wonder how they come up with that. And notice that they have
<configSections > section above at the start of it. I can't find any info
about that anywhere.

Thanks.

----------------------------------------------------------------------------
---- -----------------------------------------------------------------------
---------
"Ken Cox [Microsoft MVP]" <BA************ @sympatico.ca> wrote in message
news:OP******** ******@TK2MSFTN GP09.phx.gbl...
You've got to use the correct keywords and syntax. You can't make up your
own hierarchy like that. You'll want something like this:

<appSettings>
<add key="Applicatio n1" value="MyApplic ation1" />
<add key="Setting1" value="MySettin g" />
</appSettings>

See the hierarchy here:

http://msdn.microsoft.com/library/de...ionsschema.asp
Ken
"Razak" <ra***@mmsc.com .my> wrote in message
news:Or******** ******@TK2MSFTN GP12.phx.gbl...
Hello, I'm new with ASP.NET.

I've seen samples which has custom 'entry' in Web.Config which works well. But when I enter my 'entry', it produces app error:

The entry is like below:-

<?xml version="1.0" encoding="utf-8" ?>
<configuratio n>
<myAspApp>
<database>
<add key="connection String" value="Server=s qlserver; uid=sa;
pwd=1234; database=testDB " />
</database>
</myAspApp>

<system.web>
.
.
.
</system.web>
</configuration>
Why doesn't it work for me whereas the samples implement the same method
for
configuring its app db connection?

Please help. Thanks.

--------------------------------------------------------------------------

--
---- ---------------------------------------------------------------------

--
---------

Nov 18 '05 #3
Oopss... It seems like the link you gave already have the info I need...
thanks!

----------------------------------------------------------------------------
---- -----------------------------------------------------------------------
---------
"Razak" <ra***@mmsc.com .my> wrote in message
news:%2******** *******@TK2MSFT NGP10.phx.gbl.. .
yes.. I just found out that's one way of doing it... but I checked on a
sample project by ASP.NET Community Stater kit and they config their
application like this..

<configuratio n>
<configSections >
<sectionGroup name="community StarterKit">
<section name="Isp"
type="ASPNET.St arterKit.Commun ities.Communiti esSectionHandle r,ASPNET.Starte r Kit.Communities " />
<section name="pagePaths "
type="ASPNET.St arterKit.Commun ities.Communiti esSectionHandle r,ASPNET.Starte r Kit.Communities " />
<section name="database"
type="ASPNET.St arterKit.Commun ities.Communiti esSectionHandle r,ASPNET.Starte r Kit.Communities " />
<section name="services"
type="ASPNET.St arterKit.Commun ities.Communiti esSectionHandle r,ASPNET.Starte r Kit.Communities " />
</sectionGroup>
</configSections>

<communityStart erKit>
<Isp>
<add key="IspUsernam e" value="admin" />
<add key="IspPasswor d" value="a1854928 " />
</Isp>

<pagePaths>
<add key="basePage" value="/communityDefaul t.aspx" />
<add key="baseServic e" value="/communityServic e.asmx" />
</pagePaths>

<database>
<add key="connection String"
value="server=l ocalhost;uid=sa ;pwd=secret;dat abase=community StarterKitNEW"
/>
</database>

<services>
<add key="enableServ iceTimer" value="true" />
</services>
</communityStarte rKit>
<system.web>
<compilation debug="false" />
.....

I wonder how they come up with that. And notice that they have
<configSections > section above at the start of it. I can't find any info
about that anywhere.

Thanks.

-------------------------------------------------------------------------- -- ---- --------------------------------------------------------------------- -- ---------
"Ken Cox [Microsoft MVP]" <BA************ @sympatico.ca> wrote in message
news:OP******** ******@TK2MSFTN GP09.phx.gbl...
You've got to use the correct keywords and syntax. You can't make up your
own hierarchy like that. You'll want something like this:

<appSettings>
<add key="Applicatio n1" value="MyApplic ation1" />
<add key="Setting1" value="MySettin g" />
</appSettings>

See the hierarchy here:

http://msdn.microsoft.com/library/de...ionsschema.asp

Ken
"Razak" <ra***@mmsc.com .my> wrote in message
news:Or******** ******@TK2MSFTN GP12.phx.gbl...
Hello, I'm new with ASP.NET.

I've seen samples which has custom 'entry' in Web.Config which works

well. But when I enter my 'entry', it produces app error:

The entry is like below:-

<?xml version="1.0" encoding="utf-8" ?>
<configuratio n>
<myAspApp>
<database>
<add key="connection String" value="Server=s qlserver; uid=sa; pwd=1234; database=testDB " />
</database>
</myAspApp>

<system.web>
.
.
.
</system.web>
</configuration>
Why doesn't it work for me whereas the samples implement the same method for
configuring its app db connection?

Please help. Thanks.


--------------------------------------------------------------------------
--


---- ---------------------------------------------------------------------
--
---------


Nov 18 '05 #4

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

Similar topics

1
1624
by: VK | last post by:
Hi! Can entry widget be scrolled? VK TypeError: xview() takes exactly 2 arguments (4 given) Code:
0
300
by: Lakshmikanth | last post by:
Hi, In my web application, i have coded to log an entry in application log, if any error occurs on any page. It works fine with NTLM Authentication and custom error mode is set to "Off" in web.config. If i enable access for anonymous users the log entry is not writing an event in the application log. (i mean administrator of the server can...
4
2198
by: redryderridesagain | last post by:
My macro is writing to a table(T) and reading a query (Q) based on that table (VBA/Visual Basic 6.3). I cannot write T and read Q in the same execution of the macro, however, if I skip the writing part I can read Q just fine. How does closing the macro reset the state of the system? The SQL for Q is-- SELECT Relatesto.contains,...
0
1830
by: Søren Lund | last post by:
Hello, I have implemented a custom config section handler by implementing the IConfigurationSectionHandler interface. I have registered this handler in web.config and everything works fine ... for a while. At random points in time my section handler stops working and throws the exception: Configuration Error Description: An error...
1
1625
by: Karl Lang | last post by:
Hi I've created a new configuration section in Web.Config to hold the connection string for my database. If I have Option Strict On I get a message "Option Strict On disallows late binding" when I try to retrieve the string. Now I'd rather not turn off option strict but I'd also prefer to have my connection string in one place. Does anyone...
5
1550
by: Mossman | last post by:
Hello, I am not sure what to look at next on this issue so any information and/or links to web sites would be greatly appreciated. I have developed an ASP.NET application using VB.NET. I tested and debugged it successfully on my PC using IIS. Once I was ready to deploy the application, I created a staging virtual directory on my D:...
6
1671
by: baerland | last post by:
Hi all! I have browsed through houndreds of threads with problems conserning web.config, but not yet found a solution to this problem. I have a test server running .NET 1.0, 1.1 and 2.0 I have a web application (virtual directory with application set), with a web.config file. The asp.net properties of this application is set to use .NET...
4
3220
by: ChrisFrohlich | last post by:
I am trying to deploy two copies of an application to a single website using two virtual directories: "2007" (Production) and "Demo". Each of these applications should point at a different DB, so my thought was to leave everything the same, make two copies of the application files, and just edit the Web.Config file in each copy of the...
4
1645
by: so many sites so little time | last post by:
ok so i am having problems if you look at the script below you will see that it the query has 4 values to insert but the actual values only contain title entry and now() for the date. well i have made the database and the blog_id is a primary auto interger what ever table bascly look below the the insert code block to find the code block...
0
7618
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8138
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...
1
7679
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...
0
6287
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...
1
5514
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...
0
5223
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...
0
3657
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3647
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1228
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.