sql - VB.Net Linq with datatables - select from one table what does not exist in the other -


i have 2 data on have applied linq select lines :

csql = "select * v_vente code_projet=" & comprojet.getcolumnvalue("code_projet") & " " dim tabvnt datatable = utilitaire.getdatatable(csql)  dim query1 = tabvnt.asenumerable().where(function(r) directcast(r("date"), date) >= dtdu , directcast(r("date"), date) <= dtau)  dim tabannule datatable = utilitaire.getdatatable("select  * v_reserv_annule") dim query2 = cust in tabannule.asenumerable() (cust.type = "définitif" or cust.type = "transfert") , cust.date_annule <= dtau 

now want select rows "query1" "num_r" not exist in "query2". column "num_r" exist in both datatable "tabvnt" , "tabannule" i've tried code doesn't work,please me find error :

dim rows = t1 in query1 .asenumerable() join t2 in query2.asenumerable() on t1.field(of string)("num_r") equals t2.field(of string)("num_r") tg         tcheck in tg.defaultifempty()         tcheck = null         select t1() 

if have understood code right, can check if second table's num_rs not contain table 1 num_r:

dim rows = t1.where(x=> !t2.select(y=> y.num_r).contains(x.num_r)); 

Comments

Popular posts from this blog

python - How to insert QWidgets in the middle of a Layout? -

python - serve multiple gunicorn django instances under nginx ubuntu -

module - Prestashop displayPaymentReturn hook url -