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. Determing SQL Express Instance name using C#

Determing SQL Express Instance name using C#

Scheduled Pinned Locked Moved C#
questioncsharpdatabasetutorial
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.
  • W Offline
    W Offline
    wasife
    wrote on last edited by
    #1

    :confused:Hi, Can any body tell me 1. How can i programmatically get the instance name of SQL express on a system? 2. Sometimes we connect with SQL express using its instance name and on some systms we dont use the instance name, what is the difference between the two? 3.How can i adapt my Connectin String considering this situation? Below is the example con.ConnectionString=".......Data Source=secb"; con.ConnectionString=".......Data Source=secb\\SQLExpress"; 4. How can i enumerate only SQL Express instances on the local system? Thanks in advance, Wasif Ehsan.

    E 1 Reply Last reply
    0
    • W wasife

      :confused:Hi, Can any body tell me 1. How can i programmatically get the instance name of SQL express on a system? 2. Sometimes we connect with SQL express using its instance name and on some systms we dont use the instance name, what is the difference between the two? 3.How can i adapt my Connectin String considering this situation? Below is the example con.ConnectionString=".......Data Source=secb"; con.ConnectionString=".......Data Source=secb\\SQLExpress"; 4. How can i enumerate only SQL Express instances on the local system? Thanks in advance, Wasif Ehsan.

      E Offline
      E Offline
      Ed Poore
      wrote on last edited by
      #2

      There's an SqlEnumerator class or something named similar in one of the System.Data namespaces. I think it's under System.Data.Sql but it may be under the System.Data.SqlClient namespace.


      I have no idea what I just said. But my intentions were sincere.

      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