Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6626553
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T21:54:20+00:00 2026-05-25T21:54:20+00:00

I have an asp.net web application that I made in Visual Studio 2008. Everything

  • 0

I have an asp.net web application that I made in Visual Studio 2008. Everything worked just fine until I switched to VS 2010. When that happened, I started seeing some weird behavior with my database connection string. The string (edited, but format is the same) is as follows:

<add name="DBname" connectionString="Data Source=SomeText\SomeMoreText;Initial Catalog=DB;Integrated Security=True" providerName="System.Data.SqlClient"/>

The problem is with the SomeText\SomeMoreText part.
When I run this in the debugger, the ‘\’ is changed into ‘\\’. This breaks everything.

My question, which probably has an extremely simple answer is this:
How can I get VS2010 to treat the connection string like a normal string without trying to insert the extra slash?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T21:54:21+00:00Added an answer on May 25, 2026 at 9:54 pm

    The extra slash is not there as far as interpretation of the string is concerned. It is merely an escape character ‘\’ before the slash ‘\’.

    Want proof? Add the following to your code (with proper naming of course):

    Debug.WriteLine(connectionStringValueHere);
    

    Here is a small app:

            string test = "This\\is\\a\\test";
    
            Console.WriteLine(test);
            Debug.WriteLine(test);
    
            Console.Read();
    

    Note that the string, in both console and debug (output window) is This\is\a\test. If you do the following in the immediate window when the code is at a breakpoint:

     ? test
    

    You see the following output

    ? test
    "This\\is\\a\\test"
    

    But you have the escapes present, which is normal for strings in .NET.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a very simple ASP.NET web application created under Visual Studio 2008 (SP1),
I have an ASP.NET web application that is using forms authentication. Everything is configured
I have an ASP.NET web application that, for whatever reason, when it is deployed
We have a asp.net 2.0 web application that is running on IIS7. It is
Suppose you have two seperate ASP.NET Web Application projects that both need to use
I am developing an ASP.NET web application that incorporates google maps. I have an
i have a couple of xml files in my asp.net web application that i
Let me share the following scenario: I have a ASP.NET intranet Web-based application that
I have an ASP.net web service that I'm using for a web application which
I have an Asp.Net MVC application that works in the vs.net development web server.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.