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            }
      
  • 相关阅读:
    codevs1231 最优布线问题
    P1352 没有上司的舞会——树形DP入门
    codevs1961 躲避大龙
    codevs2833 奇怪的梦境
    linux 内存管理——内核的shmall 和shmmax 参数
    删除共享内存后key为0x00000000的问题
    redis命令之lrange
    vim配置vimrc详解
    chmod chgrp chown
    localtime和localtime_r
  • 原文地址:https://www.cnblogs.com/abcdwxc/p/1012999.html
Copyright © 2011-2022 走看看