Get the Enum Type from a Integral Value

In the following example it shows how to retrieve the Enum Type from the integer value. For that we use The Enum Class. In the example i have used a DataSet where ORGANIZATION_TYPE is the column name which contain the integral value and the OrganizationType is the Enum.

foreach (DataRow item in ds.Tables[0].Rows)
        item["ORGANIZATION_TYPE"] = Enum.Parse(typeof(OrganizationType), item["ORGANIZATION_TYPE"].ToString()).ToString();




Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s