![](/img/trans.png)
[英]LINQ query throwing 'Conversion from string to type 'Long' is not valid' error
[英]conversion from string to type 'double' is not valid in LINQ query
在下面的Linq查詢中,我從字符串轉換為“ double”類型錯誤:
Dim query = From Corrections In Test _
Where Not Corrections.Expected_Bill = Corrections.Bill _
Select Corrections.Account, _
Corrections.Site, _
Action = If(Corrections.Bill = "No billing PLI", _
+"This site has no billing PLI set up; " _
+ "please add " + Corrections.Expected_Bill, _
+"This site has an incorrect billing PLI set up; " _
+ "please remove " + Corrections.Bill + " and " _
+ "add " + Corrections.Expected_Bill)
看起來查詢的'If(Corrections.Bill =“ No billing PLI”“部分是引發異常的部分,但是鑒於所有字段均為文本,因此我不明白為什么會發生這種情況。
逗號后有一個多余的+
。 更換
+"This site has an incorrect billing PLI set up; " _
與
"This site has an incorrect billing PLI set up; " _
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.