1 つのテーブル列に 2 つのテーブルがあり、FID です。FID はテーブル'tblRe '
にあり、db の型は文字列であり、他のテーブル列は MID です。MID はテーブル'tblVeh'
にあり、db の型は int です。両方の値は同じですが、名前は異なります。調整しようとしましたが、これはエラーを示しています
string data = "[";
var re = (from veh in DB.tblVeh
join regh in DB.tblRe on
new{MID=veh .MID} equals new {MID=tblRe .FID}
where !(veh .VName == "")
group veh by veh .VName into g
select new
{
Name = g.Key,
cnt = g.Select(t => t.Name).Count()
}).ToList();
data += re.ToList().Select(x => "['" + x.Name + "'," + x.cnt + "]")
.Aggregate((a, b) => a + "," + b);
data += "]";
私はこれを試します
new{MID=veh .MID} equals new {MID=tblRe .FID}
エラー
The type of one of the expressions in the join clause is incorrect. Type inference failed in the call to 'Join'.
任意のソリューション