Convert a string to an enum

User Enum.Parse is your friend

enum StatusEnum {Active,Inactive}

StatusEnum MyStatus = (StatusEnum) Enum.Parse( typeof(StatusEnum), "Active");

Comments

Popular posts from this blog

OCR text detection with google APIs C#

The specified version string contains wildcards, which are not compatible with determinism.

How to set dynamically height/width of an external image in rdlc report?