using(SqlConnection _con = new SqlConnection(your-connection-string)) { string instanceName = new Microsoft.SqlServer.Management.Smo.Server (new ServerConnection(_con)).InstanceName; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)