DataTable dt = System.Data.Sql.SqlDataSourceEnumerator.Instance.GetDataSources();
The returned DataTable contains a column, ServerName.SqlConnectionStringBuilder csBuilder; security = "Integrated Security=True"; csBuilder = new SqlConnectionStringBuilder(string.Format("server={0};{1}", ServerName, security)) using (SqlConnection connection = new SqlConnection(this.csBuilder.ConnectionString)) { connection.Open(); this.dtDatabases = connection.GetSchema("Databases"); connection.Close(); // to get a list of tables in a database foreach (DataRow row in this.dtDatabases.Rows) { // for some reason, accessing the "model" database in this manner prevents the // CREATE DATABASE from getting an exclusive lock on it, even though the connection gets closed // so we'll exclude it from this process if (row["database_name"].ToString().ToLower() == "model") continue; this.csBuilder.InitialCatalog = row["database_name"].ToString(); connection.ConnectionString = this.csBuilder.ConnectionString; connection.Open(); this.dtTableNames = connection.GetSchema("Tables", new string[] { null, null, null, "BASE TABLE" }); // more code }Now, that said, I've also utilized SMO for updating tables in databases and the like, but by using the above code for at least finding servers on the network, you may be able to tell whether you need to install SMO or not.