Exemplo n.º 1
0
 public List<string> GetDatabases(DbConnection conn)
 {
     var res = new List<string>();
     using (var reader = conn.RunOneSqlCommandReader(String.Format("select name from [{0}].master.sys.databases", Name)))
     {
         foreach (DataRow row in reader.ToDataTable().Rows)
         {
             res.Add(row["name"].SafeToString());
         }
     }
     return res;
 }
Exemplo n.º 2
0
 public static List<SqlServerLinkedServer> GetLinkedServers(DbConnection conn)
 {
     var res = new List<SqlServerLinkedServer>();
     using (var reader = conn.RunOneSqlCommandReader("exec sp_linkedservers"))
     {
         foreach (DataRow row in reader.ToDataTable().Rows)
         {
             res.Add(new SqlServerLinkedServer
                 {
                     Name = row["SRV_NAME"].SafeToString(),
                 });
         }
     }
     return res;
 }