Hi,
try this code to get all the SQL Server instances in the local Network.
System.Data.DataTable Dt = System.Data.Sql.SqlDataSourceEnumerator.Instance.GetDataSources();
Server obj = new Server(new Microsoft.SqlServer.Management.Common.ServerConnection("<instancename>"));
</instancename>
Regards
AR