ich Csharp Linq bin mit dem folgenden Berichtmit Linq mit join mit zwei, wo auf zwei Tabellen
Ich habe zwei Tabellen wie unten
#Users nid pid name 1 1 name1 2 1 name2 #Transactions nid tid location dcode 1 T1 L1 D1 2 T1 L2 D1 2 T2 L1 D1 2 T2 L3 D1
Der Bericht enthält
a) columns from users table where nid != pid b) columns from transactions where tid == T2 and nid = results from a) c) the combination can have only one top row in result nid name tid Location 2 name2 T2 L1 the second record will not be present - 2 name2 T2 L3
erstellen Ich habe Folgendes versucht, mit Join
var report = (from u in users where u.nid != u.pid
join t in transactions
where t.tid == "T2"
on u.nid equals t.nid
select new
{
// the report columns
}).Distinct().ToList();
auf dem zweiten ‚wo‘ ein Fehler angezeigt wird
Sie danken für jede Unterstützung
ja, der fehler ist verschwunden, ich werde es als antwort nach 8 minuten bezeichnen .. danke nochmal – arvind