472,958 Members | 2,624 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,958 software developers and data experts.

web.config appSettings Store value with & character

hi

i have stored my connction string in web.config as we do usually. code
of web.confing is given below.

check the password field contain "&" character. now when i run my
application it gives error because value of ConnectionString is breaked
at "&".

So how to store value in web.config that contain "&" character, if any
one know the solution pls let me know. code of web.config and error
given by visual studio is given below.

<configuration>
<appSettings>
<add key="ConnectionStri

ng" value="server=localhost;user id=mas;password=mas&2003;database=CMS"
/>
</appSettings>
....
....
and so on </configuration>

Error Give by VS 2003
Configuration Error
Description: An error occurred during the processing of a configuration
file required to service this request. Please review the specific error
details below and modify your configuration file appropriately.

Parser Error Message: Reference to undeclared parameter entity, 'max'.

Source Error:

[No relevant source lines]
Source File: D:\dnSource\HOMEAPPS_mahesh\web.config Line: 0

Aug 8 '06 #1
2 8139
Instead of this:

value="server=localhost;user id=mas;password=mas&2003;database=CMS"

try this:

value="server=localhost;user id=mas;password=mas&2003;database=CMS"

the & will be converted to & when the value is retrieved from the web.config
"ma***********@gmail.com" wrote:
hi

i have stored my connction string in web.config as we do usually. code
of web.confing is given below.

check the password field contain "&" character. now when i run my
application it gives error because value of ConnectionString is breaked
at "&".

So how to store value in web.config that contain "&" character, if any
one know the solution pls let me know. code of web.config and error
given by visual studio is given below.

<configuration>
<appSettings>
<add key="ConnectionStri

ng" value="server=localhost;user id=mas;password=mas&2003;database=CMS"
/>
</appSettings>
....
....
and so on </configuration>

Error Give by VS 2003
Configuration Error
Description: An error occurred during the processing of a configuration
file required to service this request. Please review the specific error
details below and modify your configuration file appropriately.

Parser Error Message: Reference to undeclared parameter entity, 'max'.

Source Error:

[No relevant source lines]
Source File: D:\dnSource\HOMEAPPS_mahesh\web.config Line: 0

Aug 8 '06 #2
hmmm... this post converted my xml ! lol

I entered in & a m p ; (no spaces) and it became & in the post ! LOL !!

Use &amp and a ; and this should work fine :P
Aug 8 '06 #3

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

Similar topics

4
by: Guinness Mann | last post by:
I'm working in VS2003.NET, with C#. I use app.config to store the connection string to my SQL Server. This works fine. Lately I've been taking work home where the connection string is...
5
by: WFB | last post by:
Hi, I have an application with a couple of referenced assemblies. The referenced assemblies and my application all share a few configuration settings with the same name but different values. ...
8
by: theWizard1 | last post by:
Using Asp.NET 1.1, and C#. I have a directory for the website, and a directory under it named Secure. I have a web.config in each of the above directories. The web.config in the Secure...
2
by: Ian | last post by:
Hi, I am trying to use machine.config to store database settings for a connection wrapper class I am using as part of the data layer of an n-tier system. Have added the following section to...
1
by: Max | last post by:
hi i have stored my connction string in web.config as we do usually. code of web.confing is given below. check the password field contain "&" character. now when i run my application it gives...
10
by: Brett Romero | last post by:
I'd like to store something such as the following the my app.config file: <?xml version="1.0" encoding="utf-8" ?> <configuration> <appSettings> <add key="DEBUG" value="true"/> <add...
5
by: Keith | last post by:
Hello all, I have a C# Windows Forms app. It is in namespace App.GUI. It builds to Nav.exe. I have entered an application level setting using the designer. Its type is string, name is "FOO"...
6
by: G | last post by:
Hello, Is it possible (and / or wise) to add custom pieces of code inside your Web.Config file? For example I store the connection string in Web.Config and access it via...
6
by: Peted | last post by:
Hi, im wanting to store some custom text strings in the app.config file of a c# app, to be retreived and updated when the app runs. using c# 2005 express in my testing i am using the code...
3
by: =?Utf-8?B?Sm9u?= | last post by:
Hello, I have tried to use the app.config and settings.cs files to store my data (which I want to be user changeable at runtime). I can write to (what I assume is an object in memory) and it does...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...

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.