zoukankan      html  css  js  c++  java
  • 查询多列数据时用这种方法查询

     1  private void cbbType_SelectedIndexChanged(object sender, EventArgs e)
     2         {
     3             //清空DN列
     4             cbbDn.Items.Clear();
     5             //字段清除
     6             FieldListSaddle.Clear();
     7             //加入字段
     8             FieldListSaddle.Add("Baojiao,Drawing,Table,Ribs,Type1,HasPad");
     9             //定义查询条件
    10             string where = string.Format("DnX < {0} and DnD >= {0} and Type2 = '{1}'", DI, cbbType.Text);
    11             //按照条件查询表
    12             tbBiao = GetAccessData(TypeName, FieldListSaddle, where);
    13             //如果表中有两列数据则需要循环查找并添加
    14             for (int i = 0; i < tbBiao.Rows.Count; i++)
    15             {
    16                 //表名等于第一行数据的表
    17                 string TableName = (tbBiao.Rows[i]["Table"]).ToString();
    18                 //查询出DN表放入内存
    19                 tbDn = GetAccessData(TableName);
    20                 //查询出符合DN的那一列
    21                 DnList = tbDn.AsEnumerable().Select(p => p.Field<double>("DN").ToString()).Distinct().ToList();
    22                 //加入控件中
    23                 cbbDn.Items.AddRange(DnList.ToArray());
    24             }
    25         }
    View Code
  • 相关阅读:
    install git on ubuntu
    deploy uwsgi with niginx on ubuntu
    ubuntu下部署solr
    solr relevent project
    20100722
    [Programming Visual C++]Ex05cCScrollView Revisited
    iter_test
    交友类节目
    install scrapy on windows
    20100703
  • 原文地址:https://www.cnblogs.com/xzh1993/p/4155856.html
Copyright © 2011-2022 走看看