zoukankan      html  css  js  c++  java
  • 将sql server数据库表中的字段绑定到表usa的例子

    将sql server数据库表中的字段绑定到表usa的例子
    //绑定远程属性数据表(sql server)
    //打开地图目标表
    Table targetTbl=Session.Current.Catalog.OpenTable (@"C:\Program
    Files\MapInfo\Professional\Data\Map_Data\Namerca\USA\Usa_Maps\USA.tab");
    FeatureLayer targetLyr=new FeatureLayer (targetTbl,"targetTbl","TargetTable");
    mapControl1.Map.Layers.Add (targetLyr);
    //打开数据源表(在sql server中),表中需要要唯一关键字段。
    MapInfo.Data.TableInfoServer ti=new  TableInfoServer("sourcetable");
    ti.ConnectString ="Driver={SQL Server};Server=Lixiaohui;database=test; Uid=sa; Pwd=sa;";
    ti.Query="select * from us_cust";
    ti.Toolkit=MapInfo.Data.ServerToolkit.Odbc;
    Table srcTbl=Session.Current.Catalog.OpenTable(ti);
    MessageBox.Show (this,srcTbl.TableInfo.Columns.Count.ToString());
    //从源表中将字段加入到目标表,以state(州名)字段为连接字段,加入的字段为以州为单位的订单数。
    Columns cols=new Columns();
    cols.Add (new Column("sumOrder",MIDbType.Int,"Sum(ORDER_AMT)"));
    targetTbl.AddColumns (cols,MapInfo.Data.BindType.Static,srcTbl,"Upper(STATE)",MapInfo.Data.Operator.Equal,"Upper(State)");

  • 相关阅读:
    emlog6.0代码审计
    Linux系统
    PHP反序列化链挖掘
    Yii框架反序列化RCE利用链分析
    CVE-2020-1472漏洞复现
    linux 报错 Input/output error
    SKimage
    layui 统计行totalRow 保留两位小数
    linux清空历史命令(history)
    shred 命令详解
  • 原文地址:https://www.cnblogs.com/googlegis/p/2978974.html
Copyright © 2011-2022 走看看