Enum question

I don't understand what these 2 lines are doing:

    private SortColumns? _SortColumn;
    private SortDirection? _SortDirection;

if I have this in the page:

    private enum SortColumns
    {
        Title,
        Name
    }

    private enum SortDirection
    {
        Ascending,
        Descending
    }
LVL 1
dba123Asked:
Who is Participating?
 
ksaulConnect With a Mentor Commented:
the ? is a short cut syntax for System.Nullable<type>

http://msdn2.microsoft.com/en-us/library/2cf62fcy.aspx
0
 
ksaulCommented:
private SortColumns? _SortColumn;
_SortColumn = null; //OK

vs

private SortColumns _SortColumn;
_SortColumn = null; //Compile error
0
All Courses

From novice to tech pro — start learning today.