|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
<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. |
|
#2
|
|||
|
|||
|
Stupid question: why do you need two back slashes?
|
|
#3
|
|||
|
|||
|
NOT a stupid question
Quote:
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! |
![]() |
| Viewing: Dev Articles Community Forums > Programming > .NET Development > <appSettings> in Configuration |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|