using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.SqlServer.Management.Smo;
namespace FirstDatabase
{
    class Program
    {
        static void Main(string[] args)
        {
         Server canopus5 = new Server("CANOPUS5");
         Database firstDatabase = canopus5.Databases[0];
          Urn firstUrn = firstDatabase.Urn;
            Console.WriteLine(firstDatabase.Name);
            canopus5.ConnectionContext.Disconnect();
            Database tryAgain =
               (Database)canopus5.GetSmoObject(firstUrn);
            Console.WriteLine(tryAgain.Name);
        }
    }
}
