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

  • Home
  • SEARCH
  • 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 4093824
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T19:40:00+00:00 2026-05-20T19:40:00+00:00

In vb.net, I got an Enum defined As Integer: Enum enUtilityTypeDetailStudentEntryWorkflow As Integer enUTDSEW_Default

  • 0

In vb.net, I got an Enum defined As Integer:

    Enum enUtilityTypeDetailStudentEntryWorkflow As Integer
        enUTDSEW_Default = 379
        enUTDSEW_ApplicantRecordBook = 380
    End Enum

I would like to assign the Enum directly to a variable but it does not work.

        EntryWorkflowLookUpEdit.EditValue = enUtilityTypeDetailStudentEntryWorkflow.enUTDSEW_Default

I ended up using a CType and converting it to an Integer.

        EntryWorkflowLookUpEdit.EditValue = CType(enUtilityTypeDetailStudentEntryWorkflow.enUTDSEW_Default, Integer)

This works but it adds a lot of noise to the code and it seems like the Enum is already defined as an Integer, making me think, why do I have to assign it again?

Is there other ways to accomplish this without all the noise?
I know I am missing something here.

Thanks a bunch.

  • 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-05-20T19:40:00+00:00Added an answer on May 20, 2026 at 7:40 pm

    The enum is defined as using an integer as its underlying type.

    It’s a good thing that this is an explicit conversion IMO, because it means you don’t accidentally end up using an enum value where you really meant to just use a straight integer. The point of enums is to effectively have different “views” of numbers – and changing which “view” you’re using should be explicit.

    I would expect there to be relatively few such conversions in most codebases.

    If this becomes a significant issue for you, you could always write an extension method of ToInt32 or something like that, which just performed the cast.

    Personally if I were trying to reduce the noise in this code, I’d try to find a shorter name than enUtilityTypeDetailStudentEntryWorkflow – and one which conformed with the .NET naming conventions, at the same time.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I got a Utility module since VB.NET doesn't have static class like C# and
We've got a .net CMS running on IIS 6 which uses XSLT templates. It
I've got a .NET 3.5 class lib that I am trying to write some
I got a asp.net portal lanching a 3.5 sp1 partial trust XBAP. The portal
I've got an ASP.NET app using NHibernate to transactionally update a few tables upon
I've got an asp.net ajax style AccordionPane control that I am trying to get/set
I've got a relatively large .Net system that consists of a number of different
I've got an ASP.NET 2.0 website with a custom 404 page. When content is
I've got build server running CruiseControl.NET and recently it started throwing this error on
I've got an arbitrary list of .NET assemblies. I need to programmatically check if

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.