• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 322
  • Last Modified:

C# Declaratoin Syntax ?

I've been trying to implement NetTiers and while reviewing the generated code I've found some Class Property Declaration syntax I'm not familiar with;
public System.Int32? BillingType_ID
{
  get
  {
     return Fields["BillingType_ID"].ConvertValue< System.Int32? >();
  }
  set
  {
    Fields["BillingType_ID"].Value = value;
  }
}

What is the ? for when added to the back of System.Int32 ?
0
CDFA_Inc2
Asked:
CDFA_Inc2
  • 3
1 Solution
 
wnrossCommented:
The ? indicates that this is a nullable type:

[from msdn]
Nullable types are instances of the System.Nullable struct. A nullable type can represent the normal range of values for its underlying value type, plus an additional null value.

The point of this is to differentiate a null (no value assigned) from a "null value" such as one would find from
a SQL query.

Cheers,
-Bill
0
 
basavaraj_knCommented:
Hi

Please look at the below link it should clear all your doubts
http://msdn2.microsoft.com/en-us/library/ms173224.aspx
~BAS
0
 
wnrossCommented:
Bas:

That link is to the ?? operator, not to the nullable type declaration.

-Bill
0
 
wnrossCommented:
Glad to help
-Bill
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now