0
我已經遵守了該怎麼辦我的電燈開關係列,和代碼轉換,因爲我從VB到C#誤差計算財產
我越來越粘在被乘以兩個字段並返回一個計算的屬性去結果
錯誤是「無法隱式轉換類型'小數?到'十進制'。存在明確的轉換(你是否缺少一個轉換?)「。
我不知道我爲什麼會需要一個投,因爲它們都是同一類型的
thanks,
Jason
VB代碼
Private Sub LineItemTotal_Compute(ByRef result As Decimal)
result = Me.Quantity * Me.Price
End Sub
C#代碼
private void LineItemTotal_Compute(ref decimal result)
{
result = this.Quantity * this.Price;
}
這解決了這個問題,謝謝你的建議partial void LineItemTotal_Compute(ref decimal?result) { result = this.Quantity * this.Price; } – Jason 2011-12-16 20:01:18