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

sitemap connectionstrings

I am creating a custom sitemap and when I run the site I get the following
error and the debugger trips on line 28 of the code below. Can someone
explain why I am getting this error and how to correct it?

Parser Error Message: The entry 'LocalSqlServer' has already been added.

Source Error:
Line 13: </appSettings>
Line 14: <connectionStrings>
Line 15: <add
Line 16: name="LocalSqlServer"
Line 17: connectionString="server=(local); uid=sa; pwd=sterling;
database=ca101web;"

=========
default.aspx.cs - line 28

string[] connString = ConfigurationManager.ConnectionStrings["LocalSqlServer"]
..ConnectionString.Split(new Char[] {';'});

--
Message posted via http://www.dotnetmonster.com
Jan 10 '06 #1
4 1638
The LocalSqlServer connection string is configured in the
c:\windows\Microsoft .NET\Framework\V2.0xxxx\Config\Web.config file.
Yes, there is one there also :). Of course, you can't add the same
connectionstring twice using the same name, as the name is used as the
primary key.

Wouter van Vugt
Trainer - Info Support
http://blogs.infosupport.com/wouterv

Jan 10 '06 #2
I am confused with the way the custom sitemap is supposed to work. Line 28
comes from my Page Load and it is pulling the connection string from the web.
config. I thought I needed the name of the connection string in line 28 in
order to get the connection string information? I am then calling the
Initialize method with the namevaluecollection from the connection string. Am
I incorrect in my architecture?

Wouter van Vugt wrote:
The LocalSqlServer connection string is configured in the
c:\windows\Microsoft .NET\Framework\V2.0xxxx\Config\Web.config file.
Yes, there is one there also :). Of course, you can't add the same
connectionstring twice using the same name, as the name is used as the
primary key.

Wouter van Vugt
Trainer - Info Support
http://blogs.infosupport.com/wouterv


--
Message posted via http://www.dotnetmonster.com
Jan 10 '06 #3
You should use a SiteMapDataSource, and set its Provider property. Then
in the web.config you configure a custom SiteMapProvider, here you also
set the connectionString. On line 28 of your code, you can use the name
of the connectionstring, that isn't the problem. THe problem here is
that the connectionstring you are requesting exists two times, one in
the web.config for your root directory. One for the
C:\windows\Microsoft.NET\..... folder.

Grtz, Wouter

Jan 11 '06 #4
Thank you for your help!

Wouter van Vugt wrote:
You should use a SiteMapDataSource, and set its Provider property. Then
in the web.config you configure a custom SiteMapProvider, here you also
set the connectionString. On line 28 of your code, you can use the name
of the connectionstring, that isn't the problem. THe problem here is
that the connectionstring you are requesting exists two times, one in
the web.config for your root directory. One for the
C:\windows\Microsoft.NET\..... folder.

Grtz, Wouter


--
Message posted via DotNetMonster.com
http://www.dotnetmonster.com/Uwe/For...p-net/200601/1
Jan 11 '06 #5

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

Similar topics

1
by: chris.rust | last post by:
Has anyone else had any trouble setting up a sitemap view to be filtered by roles? We've put a cust role provider in place, and we can verify that it's only being called once for each...
5
by: JJ | last post by:
Although this question involves Flash, I suspect the actual issue is an asp one.. I am trying to open the web.sitemap file in an .swf file enbedded in an asp page (I'm working in VS 2005). I...
4
by: shapper | last post by:
Hello, I have 2 questions about Asp.Net 2.0 web.sitemap: 1. Where can I find the list of all siteMapNode attributes? I looked eveywhere and couldn't find it. 2. I created a Web.sitemap...
4
by: shapper | last post by:
Hello, I am trying to convert an Asp.Net 2.0 XML sitemap file to a Google's sitemap file. I am posting the formats of both files. 1. How can I do the conversion? 2. And can I use an...
5
by: Tim Mackey | last post by:
hi, i have put my web.sitemap in /App_Data so i can edit it programatically via a web admin page, inheriting the modify permissions from the App_Data folder etc. i was hoping the provider would...
0
by: vncntj | last post by:
i have this in page.aspx <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:PMAIntranetContentConnectionString %>" SelectCommand="SELECT , FROM ...
0
by: Chris | last post by:
Hi, i have a problem with sitemap combined with roles. I already posted this but i reformulated simplier: here: there are two defined users: user1 and user2 there is one role: manager user1...
1
JamieHowarth0
by: JamieHowarth0 | last post by:
Hi guys, So the ever-lasting problem has remained until now - how to create a dynamic sitemap from information stored in a database. Microsoft's MSDN magazine covered how to do this using a...
7
by: Mark B | last post by:
How do I have a SiteMap based on the output of a stored procedure? (I want to pass a @LanguageCode parameter to it so it will display the top Menu in the appropriate language).
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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?
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
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...
0
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...

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.