如何比较下面给出的.NET描述中的2个数据表 [英] How do I compare 2 data tables in .NET description given below

查看:57
本文介绍了如何比较下面给出的.NET描述中的2个数据表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

下表是包含数据的表格



Below is the table contains Data

Name Jenkins from to   code      Rules taken RuleID Taken
AA    BC12   UDG  LAT   123456    MAD         1
BB    BC13   PUN  NAS   789657







下表包含我们的一些规则需要与上述数据相匹配并更新上表中的相应规则



注意规则将被修复




Below table contains some rules which we need to match with above data and update respective rule in above table

Note Rules will be fixed

No. Name Jenkins from to   code      Business Rules 
1    AA    BC12   UDG  LAT   123456    MAD
2    BB   !BC12   PUN  NAS   789657    ABC





注意!这表示不等于



我尝试过:



尝试用linq q来解决这个问题但不起作用。



Note ! this indicate not equal to

What I have tried:

Trying to solved this with with linq q however not working.

推荐答案

而不是让Jenkins成为一个代码(!BC12),你现在必须解析它,一个合适的字段并添加一个非运​​算符作为单独的字段列。



然后在你的LINQ中你可以说:



Instead of making Jenkins a "code" (!BC12), which you now have to parse, make it a proper "field" and add a "not" operator as a separate field column.

Then in your LINQ you can say:

.Where( x => 
   (x.Jenkins != z.Jenkins && z.NotJenkins) || 
   (x.Jenkins == z.Jenkins && !z.NotJenkins)
etc.





(或者有一个单独的排除列表用于查找)。



(Or have a separate "exclusion list" for lookups).


这篇关于如何比较下面给出的.NET描述中的2个数据表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆