Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Connection string

Connection string

Scheduled Pinned Locked Moved C#
databasesql-serversysadminsecurity
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    humayunlalzad
    wrote on last edited by
    #1

    connectionString1 = @"
    server = .\sqlexpress;
    integrated security = true;
    database = C:\Program Files\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL\DATA\NORTHWND.MDF;
    user instance = true";

    connectionString2 = @"
    server = .\sqlexpress;
    integrated security = true;
    database = northwind";

    connectionString1 is working fine and connectionString2 is giving the message "Cannot open database northiwnd. login failed for user XYZ". Can someone tell me whats the difference

    A 1 Reply Last reply
    0
    • H humayunlalzad

      connectionString1 = @"
      server = .\sqlexpress;
      integrated security = true;
      database = C:\Program Files\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL\DATA\NORTHWND.MDF;
      user instance = true";

      connectionString2 = @"
      server = .\sqlexpress;
      integrated security = true;
      database = northwind";

      connectionString1 is working fine and connectionString2 is giving the message "Cannot open database northiwnd. login failed for user XYZ". Can someone tell me whats the difference

      A Offline
      A Offline
      Abhinav S
      wrote on last edited by
      #2

      humayunlalzad wrote:

      atabase = C:\Program Files\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL\DATA\NORTHWND.MDF;user instance = true";

      humayunlalzad wrote:

      database = northwind";

      The difference lies in the user instance = true part of the sql. Read about user instances here.

      My signature "sucks" today

      H 1 Reply Last reply
      0
      • A Abhinav S

        humayunlalzad wrote:

        atabase = C:\Program Files\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL\DATA\NORTHWND.MDF;user instance = true";

        humayunlalzad wrote:

        database = northwind";

        The difference lies in the user instance = true part of the sql. Read about user instances here.

        My signature "sucks" today

        H Offline
        H Offline
        humayunlalzad
        wrote on last edited by
        #3

        @"
        server = .\sqlexpress;
        integrated security = true;
        database = northwind;
        user instance = true";

        I am sorry I should have mentioned before hand, that even the above string with "user instance = true" added is not working

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups