Sample Calculator

This contain a sample calculator for beginner .Net Developers

Advertisements

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();

}