set enum from string c# code example Example: how to pass string value to enum in c# MyEnum myEnum = (MyEnum)Enum.Parse(typeof(MyEnum), myString);