I am getting this
Nullable object must have a value.
error in this line:
results.Test= installment.Test1.Value;
My ‘Test’ property looks like this:
[DataMember]
public int Test{ get; set; }
And my ‘Test1’ property looks like this in LINQ2SQL Designer:
public System.Nullable<int> Test1
{
get
{
return this._Test1;
}
set
{
if ((this._test1!= value))
{
this.OnTest1Changing(value);
this.SendPropertyChanging();
this._Test1= value;
this.SendPropertyChanged("Test1");
this.OnTest1Changed();
}
}
}
What am I doing wrong here?
Your
Test1property is (still)null. The underlying field_Test1will default tonull.You can use
if
0is an acceptable default value.