forum

Home / DeveloperSection / Forums / How to set the value of an enumeration?

How to set the value of an enumeration?

Anonymous User 1485 29-Sep-2014

i have a problem setting the value od an enumeration. 

In my code I define this enumeration: 

    public enum PartType
    {
        Application,
        Operating_System,
        Hardware
    } 
    public PartType Part { get; set; }

Then, in the same class I try to set a value of this eumeration in this way (how I have read on the C# documentation):

 

   if (row["part"] == "a")
   {
        Part.Application;
   }

But it signed as error. Why? What am I missing? How can I solve?


c# c# 
Updated on 29-Sep-2014
I am a content writter !

Can you answer this question?


Answer

1 Answers

Liked By