Solved

Enum question

Posted on 2007-04-11
2
168 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…

862 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

22 Experts available now in Live!

Get 1:1 Help Now