我用兩個表(A & B),以獲得不屬於那裏B.項目列表中選擇一個LINQ直接鑄造的錯誤
Dim results1 = From table1 In dt2 Where Not (From table2 In dt1 Where DirectCast(table2(0), String) = DirectCast(table1(0), String)).Any() Select DirectCast(table1(0), String)
,但我得到的錯誤
Unable to cast object of type 'System.Double' to type 'System.String'.
我需要做什麼轉換?
爲什麼你需要做轉換呢?兩列的實際類型是什麼?你目前沒有給我們一個明確的問題。 –