Mevcut ağ üzerindeki tüm kullanılabilir SQL sunucu örnekleri bir liste halinde alan method örneği.
public static IEnumerable<string> GetAvailableSqlServers(this SqlDataSourceEnumerator sqlDataSourceEnumerator)
{
return from row in SqlDataSourceEnumerator.Instance.GetDataSources().AsEnumerable()
orderby row.Field<string>(“ServerName”), row.Field<string>(“InstanceName”)
select string.Concat(
row.Field<string>(“ServerName”),
row.Field<string>(“InstanceName”) != string.Empty
? string.Concat(“\”, row.Field<string>(“InstanceName”))
: string.Empty);
}