.NET Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsProgramming.NET Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old June 14th, 2005, 10:14 PM
boston boston is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2005
Posts: 2 boston User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 26 m 34 sec
Reputation Power: 0
<appSettings> in Configuration

Hi, I'm having an issue I was hoping someone could help with. I'm running an instance of SQL Server 2000 and have the connection string in web.config:

<appSettings>
<add key="ConnectionString" value="server=lifebook\\lifebook; database=xxx; uid=xxx; pwd=xxx"/>
</appSettings>

The problem I have is when I read the configuration file with
ConfigurationSettings.AppSettings["ConnectionString"], the result is always returned with an @ symbol in front:

@"server=lifebook\\lifebook; database=xxx; uid=xxx; pwd="

This only happens when the server name contains the 2 back slashes, which I need. Does anyone know why this happens?

Thanks.

Reply With Quote
  #2  
Old June 16th, 2005, 12:08 AM
nodavies nodavies is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2005
Posts: 5 nodavies User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 43 m 16 sec
Reputation Power: 0
Stupid question: why do you need two back slashes?

Reply With Quote
  #3  
Old June 16th, 2005, 10:37 PM
boston boston is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2005
Posts: 2 boston User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 26 m 34 sec
Reputation Power: 0
NOT a stupid question

Quote:
Originally Posted by nodavies
Stupid question: why do you need two back slashes?


That was exactly it. I didn't need the extra backslash and it works correctly with one. I must escape everything by habit. Thanks for setting me straight!

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgramming.NET Development > <appSettings> in Configuration


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.

© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap