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

Check out Best Alternative to InfoPath


In this post, we will discuss how to set enum values with space in C#.Net.
Also, you can check out:

Method Overloading in C#.Net



– Read-only textbox value lost on postback asp.net

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 an 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,
}

You May Also like the Following SharePoint Online 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 →