Solved

Enum question

Posted on 2007-04-11
2
167 Views
Last Modified: 2010-04-15
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
    }
0
Comment
Question by:dba123
  • 2
2 Comments
 
LVL 10

Accepted Solution

by:
ksaul earned 125 total points
ID: 18892641
the ? is a short cut syntax for System.Nullable<type>

http://msdn2.microsoft.com/en-us/library/2cf62fcy.aspx
0
 
LVL 10

Expert Comment

by:ksaul
ID: 18892810
private SortColumns? _SortColumn;
_SortColumn = null; //OK

vs

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

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now