using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.SqlServer.Management.Smo;
namespace SMODatabaseList
{
    class Program
    {
        static void Main(string[] args)
        {
            Server server = new Server(args[0]);
            foreach (Database database in server.Databases)
            {
                Console.WriteLine(database.Name);
            }
        }
    }
}
