How to set enum valunes with spaces in c#.net?

InfoPath alternatives for form designing SharePoint
In this post we will discuss about how to set enum values with space in C#.Net. Also you can check out:
If you want to declare enum without giving any space, then you can check out this article.
But If you will give space and declare like below then it will give error.
public enum MonthYear
   {
       Jan 2014 = 0,
}
Here the error will come because of space between Jan 2014.
So below is the syntax to declare enum values with space.
 public enum MonthYear
   {
       [EnumMember(Value = “Jan 2014”)]
       Jan2014 = 0,
       [EnumMember(Value = “Feb 2014”)]
       Feb2014 = 0,
}

Similar SharePoint 2013 Tutorials


About Bijay Kumar

I am Bijay from Odisha, India. Currently working in my own venture TSInfo Technologies in Bangalore, India. I am Microsoft Office Servers and Services (SharePoint) MVP (5 times). I works in SharePoint 2016/2013/2010, SharePoint Online Office 365 etc. Check out My MVP Profile.. I also run popular SharePoint web site SharePointSky.com

View all posts by Bijay Kumar →

Leave a Reply