Connection string in vs C sharp

Posted on 2009-12-21
Last Modified: 2012-05-08
I have the following connection string in c#. what will be its equivalent in
@"SERVER=GAATLENDCTU123W\SQLEXPRESS; Initial Catalog=Test;Integrated Security=SSPI ";
Question by:AbebeDemeke
    LVL 57

    Accepted Solution

    You can use:


    Complete set of options below:
    LVL 35

    Assisted Solution

    same thing in VB.NET except you won't need @ escape character in front of the string:

    dim strConn="SERVER=GAATLENDCTU123W\SQLEXPRESS; Initial Catalog=Test;Integrated Security=SSPI "
    LVL 35

    Expert Comment

    also I'd suggest changing your connection string to the following:

    "Data Source=GAATLENDCTU123W\SQLEXPRESS;Initial Catalog=Test;Integrated Security=SSPI;"

    dim strConn as string="Data Source=GAATLENDCTU123W\SQLEXPRESS;Initial Catalog=Test;Integrated Security=SSPI;"

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    Suggested Solutions

    Title # Comments Views Activity
    SQL 2014 and VB 2015 4 38
    Multiply and round down 8 36
    SQL Question 1 26
    Two tables - Sum of values - What is the difference 31 40
    In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
    This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now