zoukankan      html  css  js  c++  java
  • MapInfo 连接Oracle

     1    //连接Oracle数据库
     2            MIConnection Connection = new MIConnection();
     3            try
     4            {
     5                Connection.Open();
     6                TableInfoServer ti = new TableInfoServer("ConnOracle");
     7                ti.ConnectString = "SRVR=Test;UID=en;PWD=en";
     8                ti.Query = "Select * From Test";
     9                ti.Toolkit = ServerToolkit.Oci;
    10                ti.CacheSettings.CacheType = CacheOption.Off;
    11
    12                MapInfo.Data.Table table = Connection.Catalog.OpenTable(ti);
    13                if (table != null)
    14                {
    15                    FeatureLayer fl = new FeatureLayer(table);
    16                    LayerHelper.SetEditable(fl, true);
    17                    fl.VolatilityHint = MapInfo.Mapping.LayerVolatilityHint.CacheIfPossible;
    18                    MapInfo.Mapping.Map map = MapInfo.Engine.Session.Current.MapFactory[0];
    19                    map.Layers.Add(fl);
    20                    MessageBox.Show("Open Server data successful!");
    21                }

    22            }

    23            catch (SqlException sqlEx)
    24            {
    25                MessageBox.Show(sqlEx.ToString());
    26            }

    27            finally
    28            {
    29                Connection .Close();                
    30            }
      
  • 相关阅读:
    BigDecimal 使用方法详解
    vbs xml 解析
    hybris
    淘宝SKU组合查询算法实现
    GitHub入门教程 Hello World for GitHub
    利用Java进行MySql数据库的导入和导出
    计算机网络自顶向下第三章传输层二TCP
    django网站搭建常用的一些代码
    django中日志使用学习记录
    python遍历当前目录并删除某文件
  • 原文地址:https://www.cnblogs.com/abcdwxc/p/1012999.html
Copyright © 2011-2022 走看看