Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
MmType.IsEmpty
Message
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Title:
Environment versions
Environment:
C# 2.0
OS:
Windows Server 2003
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01144991
Message ID:
01147765
Views:
26
Linda,

>No, the pe.Parish property is nullable. It is null because the user did not fill in that value. Here's the code from the entity object:
>
>
>/// <summary>
>/// parish
>/// </summary>
>public int parish
>{
>     get { return (int)mmType.GetNullableDbValue(this.Row["parish"]); }
>     set { this.Row["parish"] = value; }
>}
>
If the underlying data column is nullable, your property should be nullable like this:
/// <summary>
/// parish
/// </summary>
public int? parish
{
     get { return (int?)mmType.GetNullableDbValue(this.Row["parish"]); }
     set { this.Row["parish"] = value; }
}
If the underlying data column is NOT nullable, it should look like this:
/// <summary>
/// parish
/// </summary>
public int parish
{
     get { return (int)mmType.GetNonNullableDbValue(this.Row["parish"]); }
     set { this.Row["parish"] = value; }
}
Best Regards,
Kevin McNeish
Eight-Time .NET MVP
VFP and iOS Author, Speaker & Trainer
Oak Leaf Enterprises, Inc.
Chief Architect, MM Framework
http://www.oakleafsd.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform