public enum PayTypeList
{
Unknown,
Hourly,
Salary,
}
PayTypeList payType = (PayTypeList)Enum.Parse(typeof(PayTypeList), "Hourly");
// Throws an ArgumentException if the string is found not to be one of the members of the enum (in this case, if you pass in a string "Weekly" instead of "Hourly", it will throw an ArgumentException)