473,395 Members | 2,467 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,395 software developers and data experts.

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" ?>
<configuration>
<myAspApp>
<database>
<add key="connectionString" value="Server=sqlserver; uid=sa;
pwd=1234; database=testDB" />
</database>
</myAspApp>

<system.web>
Nov 18 '05 #1
3 1372
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="Application1" value="MyApplication1" />
<add key="Setting1" value="MySetting" />
</appSettings>

See the hierarchy here:

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

Ken
"Razak" <ra***@mmsc.com.my> wrote in message
news:Or**************@TK2MSFTNGP12.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" ?>
<configuration>
<myAspApp>
<database>
<add key="connectionString" value="Server=sqlserver; 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..

<configuration>
<configSections>
<sectionGroup name="communityStarterKit">
<section name="Isp"
type="ASPNET.StarterKit.Communities.CommunitiesSec tionHandler,ASPNET.Starter
Kit.Communities" />
<section name="pagePaths"
type="ASPNET.StarterKit.Communities.CommunitiesSec tionHandler,ASPNET.Starter
Kit.Communities" />
<section name="database"
type="ASPNET.StarterKit.Communities.CommunitiesSec tionHandler,ASPNET.Starter
Kit.Communities" />
<section name="services"
type="ASPNET.StarterKit.Communities.CommunitiesSec tionHandler,ASPNET.Starter
Kit.Communities" />
</sectionGroup>
</configSections>

<communityStarterKit>
<Isp>
<add key="IspUsername" value="admin" />
<add key="IspPassword" value="a1854928" />
</Isp>

<pagePaths>
<add key="basePage" value="/communityDefault.aspx" />
<add key="baseService" value="/communityService.asmx" />
</pagePaths>

<database>
<add key="connectionString"
value="server=localhost;uid=sa;pwd=secret;database =communityStarterKitNEW"
/>
</database>

<services>
<add key="enableServiceTimer" value="true" />
</services>
</communityStarterKit>
<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**************@TK2MSFTNGP09.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="Application1" value="MyApplication1" />
<add key="Setting1" value="MySetting" />
</appSettings>

See the hierarchy here:

http://msdn.microsoft.com/library/de...ionsschema.asp
Ken
"Razak" <ra***@mmsc.com.my> wrote in message
news:Or**************@TK2MSFTNGP12.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" ?>
<configuration>
<myAspApp>
<database>
<add key="connectionString" value="Server=sqlserver; 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***************@TK2MSFTNGP10.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..

<configuration>
<configSections>
<sectionGroup name="communityStarterKit">
<section name="Isp"
type="ASPNET.StarterKit.Communities.CommunitiesSec tionHandler,ASPNET.Starter Kit.Communities" />
<section name="pagePaths"
type="ASPNET.StarterKit.Communities.CommunitiesSec tionHandler,ASPNET.Starter Kit.Communities" />
<section name="database"
type="ASPNET.StarterKit.Communities.CommunitiesSec tionHandler,ASPNET.Starter Kit.Communities" />
<section name="services"
type="ASPNET.StarterKit.Communities.CommunitiesSec tionHandler,ASPNET.Starter Kit.Communities" />
</sectionGroup>
</configSections>

<communityStarterKit>
<Isp>
<add key="IspUsername" value="admin" />
<add key="IspPassword" value="a1854928" />
</Isp>

<pagePaths>
<add key="basePage" value="/communityDefault.aspx" />
<add key="baseService" value="/communityService.asmx" />
</pagePaths>

<database>
<add key="connectionString"
value="server=localhost;uid=sa;pwd=secret;database =communityStarterKitNEW"
/>
</database>

<services>
<add key="enableServiceTimer" value="true" />
</services>
</communityStarterKit>
<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**************@TK2MSFTNGP09.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="Application1" value="MyApplication1" />
<add key="Setting1" value="MySetting" />
</appSettings>

See the hierarchy here:

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

Ken
"Razak" <ra***@mmsc.com.my> wrote in message
news:Or**************@TK2MSFTNGP12.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" ?>
<configuration>
<myAspApp>
<database>
<add key="connectionString" value="Server=sqlserver; 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
by: VK | last post by:
Hi! Can entry widget be scrolled? VK TypeError: xview() takes exactly 2 arguments (4 given) Code:
0
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...
4
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...
0
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 ......
1
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...
5
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...
6
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...
4
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...
4
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...
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: 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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
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,...
0
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...
0
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,...

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.