c# - Outter joins in LINQ query -


this code works takes , matches unit_no , vehiclename shows matches need ones dont match on. loading datagrid in wpf sqlserver data , datagrid oracle data.

private void getsqloraclelinqdata()     {         var tstardata = gettrackstartruckdata();         var m5data = getm5data();          datatable comtable = new datatable();          foreach (datacolumn oracolumn in m5data.columns)         {             comtable.columns.add(oracolumn.columnname, oracolumn.datatype);           }         foreach (datacolumn sqlcolumn in tstardata.columns)         {             if (sqlcolumn.columnname == "vehiclename")                 comtable.columns.add(sqlcolumn.columnname + "2", sqlcolumn.datatype);             else                 comtable.columns.add(sqlcolumn.columnname, sqlcolumn.datatype);          }          var results = m5data.asenumerable().join(tstardata.asenumerable(),              => a.field<string>("unit_no"),             b => b.field<string>("vehiclename"),             (a, b) =>             {                 datarow row = comtable.newrow();                 row.itemarray = a.itemarray.concat(b.itemarray).toarray();                 comtable.rows.add(row);                 return row;              }).tolist(); 


Comments

Popular posts from this blog

javascript - oscilloscope of speaker input stops rendering after a few seconds -

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -