关闭

如何访问和使用 Catalog

529人阅读 评论(0) 收藏 举报

public static void MapInfo_Data_Catalog() {
    // Catalog is accessible off the Session object
    Catalog catalog = Session.Current.Catalog;
                   
    // Open a bunch of tables
    Table table = catalog.OpenTable("States.tab");
    table.SessionInfo.ReadOnly = true; // Make states ReadOnly
    table = catalog.OpenTable("world.tab");
    table = catalog.OpenTable("worldcap.tab", "World Capitals");
                   
    // Enumerate the catalog directly - includes All tables
    foreach (Table t in catalog)
        Console.Out.WriteLine("Table : {0}", t.Alias);
    Console.Out.WriteLine();
                   
    // Now enumerate through only tables that are editable (not ReadOnly)
   
    ITableEnumerator tenum = catalog.EnumerateTables(
        TableFilterFactory.FilterEditableTables());
    while (tenum.MoveNext()) {
        Console.Out.WriteLine("Table: {0}",tenum.Current.Alias);
    }
                   
    Session.Current.Catalog.CloseAll();
}

枚举
 public static void MapInfo_Data_Catalog2() {

    foreach (Table tbl in Session.Current.Catalog) {
        System.Console.WriteLine("Table: "+tbl.Alias);
    }
   
}

0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:320024次
    • 积分:4179
    • 等级:
    • 排名:第7606名
    • 原创:50篇
    • 转载:203篇
    • 译文:0篇
    • 评论:77条
    最新评论
    自己收藏的网站