i am getting error in the code getting error The value for column 'TotalValue' in table 'wsm_View_PurchaseOrderList' is DBNull.
public decimal TotalValue {
get {
try {
if (object.ReferenceEquals(tablewsm_View_PurchaseOrderList.TotalValueColumn, DBNull.Value)) {
return 0.0;
} else {
return Convert.ToDecimal(this(this.tablewsm_View_PurchaseOrderList.TotalValueColumn));
}
} catch (System.InvalidCastException e) {
throw new global::System.Data.StrongTypingException("The value for column 'TotalValue' in table 'wsm_View_PurchaseOrderList' is DBNull" + ".", e);
}
}
set { this(this.tablewsm_View_PurchaseOrderList.TotalValueColumn) = value; }
}
TotalValueColumnseems haveDBNullvalue when it assigned to non-nulldecimalequivalent. Probably certain check againstDBNull.Valueis possible.