Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
MmType.IsEmpty
Message
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Titre:
Versions des environnements
Environment:
C# 2.0
OS:
Windows Server 2003
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01144991
Message ID:
01147765
Vues:
33
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform