![](/img/trans.png)
[英]conversion from string to type 'double' is not valid in LINQ query
[英]LINQ query throwing 'Conversion from string to type 'Long' is not valid' error
我對以下LINQ查詢有問題,該查詢在帖子標題中引發了異常:
Dim test = From Match In _
(From Load In dtContacts _
Group Join Siebel In dtSiebel _
On Load("Email") Equals Siebel("EMAIL_ADDRESS") _
Into g = Group _
From LoadResults In g.DefaultIfEmpty _
Where Not LoadResults Is Nothing _
Select Email_Address = Load.Field(Of String)("Email"), _
Load_Account_Number = Load.Field(Of String)("AccountNum")) _
Group Join Acct In dtSiebel _
On Match.Email_Address Equals Acct("EMAIL_ADDRESS") _
And Not Match.Load_Account_Number Equals Acct("ACCOUNT_NUMBER") _
Into h = Group _
From MatchResults In h.DefaultIfEmpty _
Where Not MatchResults Is Nothing _
Select Contact_Row_ID = MatchResults.Field(Of String)("CONTACT_ROW_ID"), _
Match.Email_Address, _
Match.Load_Account_Number, _
Account_Num_Chk = MatchResults.Field(Of String)("ACCOUNT_NUMBER")
罪魁禍首是這條線:
And Not Match.Load_Account_Number Equals Acct("ACCOUNT_NUMBER")
對我而言,沒有意義的是,如果刪除了“ Not”子句(用於另一種用例),而其余的查詢保持不變,那么我會得到預期的結果而沒有任何異常。 這里有什么問題?
你可以試試
And Also Not Match.Load_Account_Number Equals Acct("ACCOUNT_NUMBER")
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.