zoukankan      html  css  js  c++  java
  • MapInfo 建立永久表

     1
     2        private void createTableToolStripMenuItem_Click(object sender, EventArgs e)
     3        {
     4            TableInfoNative tiReader = new TableInfoNative("abc");
     5            tiReader.TablePath = "C:\\MapTable\\abc.tab";
     6            tiReader.Columns.Add(ColumnFactory.CreateIndexedIntColumn("readerID"));
     7            tiReader.Columns.Add(ColumnFactory.CreateStyleColumn());           
     8            tiReader.Columns.Add(ColumnFactory.CreateFeatureGeometryColumn(mapControl1.Map.GetDisplayCoordSys()));
     9            tiReader.WriteTabFile();          
    10            try
    11            {
    12                if (File.Exists(tiReader.TablePath))
    13                {
    14                    File.Delete(tiReader.TablePath);
    15                }

    16                Table reader = Session.Current.Catalog.CreateTable(tiReader);
    17                FeatureLayer flReader = new FeatureLayer(reader);
    18                mapControl1.Map.Layers.Add(flReader);
    19
    20                //Save the session to a workspace file
    21                WorkSpacePersistence wsp = new WorkSpacePersistence();
    22                System.IO.File.SetAttributes("C:\\MapTable\\", System.IO.FileAttributes.Normal);
    23                wsp.Save("abcd.mws");
    24
    25            }

    26            catch (SqlException sqle)
    27            { MessageBox.Show(sqle.ToString()); }
    28                MessageBox.Show("create table successfully");           
    29           
    30        }
  • 相关阅读:
    湖南省第6届程序大赛第6题 Biggest Number
    湖南省第6届程序大赛第5题 内部收益率
    湖南省第6届程序大赛第4题 台球碰撞
    湖南省第6届程序大赛第3题 数字整除
    湖南省第6届程序大赛第二题 弟弟的作业
    湖南省第6届程序设计大赛第一题 汽水瓶
    Nginx 负载均衡配置
    Nginx 反向代理流程
    Nginx 对客户端请求的特殊处理
    Nginx文件操作的优化
  • 原文地址:https://www.cnblogs.com/abcdwxc/p/1012696.html
Copyright © 2011-2022 走看看