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. How to detect default instance of SQL Server?

How to detect default instance of SQL Server?

Scheduled Pinned Locked Moved C#
csharpdatabasesql-serversysadmintutorial
2 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.
  • B Offline
    B Offline
    bouli
    wrote on last edited by
    #1

    Hello dear gurus, I'd like to know how I can detect in C# if the default instance of MS SQL Server is installed??? Is there a way to do that??? Can someone show me a code snipet or something please? Best regards. Fred.

    There is no spoon.

    C 1 Reply Last reply
    0
    • B bouli

      Hello dear gurus, I'd like to know how I can detect in C# if the default instance of MS SQL Server is installed??? Is there a way to do that??? Can someone show me a code snipet or something please? Best regards. Fred.

      There is no spoon.

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      The default instance on a machine can be reached by connecting to localhost. So, you can try to connect and see what happens. But, if it's no running and not set to autostart, this will fail.

      Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog

      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