Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Checking for a Null value
Message
From
01/02/2007 09:45:46
Jeff Corder
Ambit Technologies, LLC
Missouri, United States
 
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Miscellaneous
Thread ID:
01190997
Message ID:
01191337
Views:
17
///
/// InventoryPK
///

public Guid InventoryPK
{
get
{
if (this.Row != null)
return (Guid)mmType.GetNonNullableDbValue(this.Row["InventoryPK"], "System.Guid");
else
return this._inventoryPK;
}
set
{
if (this.Row != null)
this.Row["InventoryPK"] = value;
this._inventoryPK = value;
}
}
private Guid _inventoryPK;

The problem comes in if I check to see if a value has been assigned. If the row has been created and nothing has been assigned, I get an error that it can't cast null to the Guid. In this instance, I can set the default when the row is created. In other circumstances, there really isn't a default.

Jeff
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform