2012-02-14 8 views

答えて

3

Rateがnullである可能性が高いnull参照例外を取得し、テーブルに新しいレコードを追加しよう...別のテーブルから

partial void SubTotal_Compute(ref decimal result) 
{ 
    // Set result to the desired field value 
     result = this.Quantity * this.Rate.PulaPerUnit; 
} 

すべて-時間です。計算を実行する前にテストを追加する必要があります。

if (Rate != null) 
{ 
    result = Quantity * Rate.PulaPerUnit; 
} 

あなたはおそらく、あなたがSubtotal_Computeを呼び出す前Rateが設定されていることを確認する必要があります。

関連する問題