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