I am relatively new to C# programming and seek your assistance in solving this constraint exception error.
I and using a bindingnavigatortoolbar each time a click the add button i get this error "This property cannot be set to a null value " and this occurs at the line " _OtherPhone = StructuralObject.SetValidV
[EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
[DataMemberAttribute()]
public global::System.String OtherPhone
{
get
{
return _OtherPhone;
}
set
{
OnOtherPhoneChanging(value);
ReportPropertyChanging("OtherPhone");
_OtherPhone = StructuralObject.SetValidValue(value, false);
ReportPropertyChanged("OtherPhone");
OnOtherPhoneChanged();
}
}
private global::System.String _OtherPhone;
partial void OnOtherPhoneChanging(global::System.String value);
partial void OnOtherPhoneChanged();N.B. Entity Framework is been used to connect to the database. (windows application) The error does not happen on all fields. The database table is setup not to accept null values
Can someone say how i correct this problem. Thanks in advance
Amit ChoudharyPosted Jun 17, 2013, 1:48 PM
When you're encountering this exception during debugging on this line, look at the call stack in Call Stack window in Visual Studio. Just look for the last statement where this property is being called for Set operation. That should be source of your problem.