6
我已經看過各種計算器的答案,但我沒有看到用linq修復我的連接的方式。Linq查詢類型推斷失敗,在加入調用
2表
var query = from tips in TblTips
where tips.Id == 30
join files in TblFiles on tips.Id equals files.Group
select new { tips, files };
錯誤:
Type inference failed in the call to Join
現在tips.Id是int,而files.Group是一個varchar
我試圖做.value的
tips.id.Value --> the word Value not working (most recent linqpad)
(int)files.Group --> it doesn't like that ...
我認爲如果'files.Group''可以是一個整數以外的東西,''tips.Id.ToString()等於files.Group''實際上會更安全。 – kmc059000
好吧,這個工程,我曾嘗試做一個Int32.Parse,並給了我一個不同的錯誤。謝謝! –