2016.1.22 利用LINQ实现DataSet内多张DataTable关联查询操作(目前未发现太大价值)
DataSet ds = new DataSet();
DataTable t1 = DBFactorySingleton.GetInstance().Factory.GetDataTable(sql_ndp).Copy();
t1.TableName = "t1";
DataTable t2 = DBFactorySingleton.GetInstance().Factory.GetDataTable(sql_naip).Copy();
t2.TableName = "t2";
ds.Tables.Add(t1);
ds.Tables.Add(t2);
var restable =
from f1 in ds.Tables[0].AsEnumerable()
from f2 in ds.Tables[1].AsEnumerable()
where f1.Field<string>("类型") + f1.Field<string>("名称") + f1.Field<string>("识别") == f2.Field<string>("类型") + f2.Field<string>("名称") + f2.Field<string>("识别")
//where f1.Field<string>("类型") + f1.Field<string>("名称")=="VOR_DME英德"
select new
{
c1 = f1.Field<string>("源"),
c2 = f1.Field<string>("类型"),
c3 = f1.Field<string>("名称"),
c4 = f1.Field<string>("识别"),
c5 = f1.Field<string>("磁差"),
c6 = f1.Field<string>("坐标"),
c7 = f1.Field<string>("频率"),
c8 = f1.Field<string>("波道"),
c9 = f1.Field<string>("天线高"),
c10 = f1.Field<string>("强制报告")
};
gdc_pmatch.DataSource = restable.ToArray();
最新文章
- 原生AJAX封装
- Python cumsums和cumprod函数
- 安装Oracle问题总结
- PC端和移动端地址适配
- [转]解决GET请求时中文乱码的问题
- select resharper shortcuts scheme
- SharePoint 2010 RBS 安装和配置的一些记录
- C#中Split函数的使用
- windows phone 生产二维码和解码本地二维码图片
- How to add route for IPV6 interface
- 常用google产品
- toJOSN()方法
- SQL Server索引进阶:第七级,过滤的索引
- Atitit..文件上传组件选择and最佳实践的总结(2)----HTTP
- MYSQL性能优化--分库分表
- sharepoint adfs Adding Claims to an Existing Token Issuer in SharePoint 2010
- java activemq初体验
- qt 画多边形(实现鼠标拖动节点)
- OmniPlan,一款让你无法自拔的项目管理工具(仅适用于MAC系统)
- HP服务器设置iLO步凑
热门文章
- linux基础(7)-IO重定向
- Linux嵌入式 -- 内核 - 内核链表
- Use default arguments instead of short circuiting or conditionals使用默认实参代替短路和条件
- 使用hibernate读取hibernate.cfg.xml文件时碰到这个错误org.hibernate.internal.util.config.ConfigurationException: Could not locate cfg.xml resource [/HibernateTest/src/hibernate.cfg.xml]
- 将【恢复和重新安装Windows】的介质指定到硬盘
- linux shell 学习笔记--变量声明与赋值,循环
- 使用zip()并行迭代
- Redis底层探秘(六):对象多态及回收
- BZOJ1280: Emmy卖猪pigs
- npm init node 通过指令创建一个package.json文件及npm安装package.json