Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8011023
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T18:54:34+00:00 2026-06-04T18:54:34+00:00

I am reading a string and matching this string to one of the enum

  • 0

I am reading a string and matching this string to one of the enum values that I have in the following line:

(DataType)Enum.Parse(typeof(DataType), row[0], true);

Is there an alternative way or more effient way to match a string with enum ? I heard that this can be done using reflection, is that possible ? any hint ? would it be more effient ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T18:54:35+00:00Added an answer on June 4, 2026 at 6:54 pm

    No, you’re definately doing this right IMO. What you might be confusing it with is that often people mark-up enums with a DescriptionAttribute to go the other way – converting an enum to a string for display purposes:

    public enum SomeEnum
    {
      [Description("This is value One")]
      Value1,
      [Description("This is value Two")]
      Value2
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have little doubt about string reading in C. string reading functions like gets,
I was reading How can I get query string values in JavaScript? on Stackoverflow
How does performance for reading/adding values from/to Dictionary(Of String, SomeReferenceType) depend on the number
I'm trying to convert a string that I'm reading from a file to lowercase
I have a simple text reading code for Visual Basic: Dim fileReader As String
I have a large file(60mb) and I am reading the file into a string
I have a problem with reading empty string in C. I want to read
I am reading a string from an xml file stored on the sdcard that
I have following text after reading a file: 06/16/2011 04:01:05 AM : Process Start
I am reading about String algorithms in Introduction to Algorithms by Cormen etc Following

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.