Please read the section of the manual that speaks about the upgrade from 1.0 to 2.0. If you have nullable fields which map to a value then you have this error occur.
.NET 2.0: nullable fields which are read into normal value types will cause non-compilable code. If you're migrating your code to .NET 2.0, you either have to do: (example)
// C#
Nullable<int> someValue = myEntity.FieldName;
' VB.NET 2005
Dim someValue As Nullable(of Integer) = myEntity.FieldName
or do something like:
// C#
int someValue = myEntity.FieldName.Value;
' VB.NET 2005
Dim someValue As Integer = myEntity.FieldName
The second option runs the risk of an exception at runtime. To avoid that do:
// C#
if(myEntity.Field.HasValue)
{
int someValue = myEntity.Field.Value;
}
' VB.NET 2005
If myEntity.Field.HasValue Then
Dim someValue As Integer = myEntity.Field.Value
End If