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 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've got a .Net dll that misses a line of code. I would like
I got a ASP.NET MVC controller like this [Authorize] public class ObjectController : Controller
I've got a .NET app and some related third party DLLs, that I would
Question: I'm trying out to convert this here: http://support.microsoft.com/kb/828736 to VB.net I got it
I've got a .NET 2.0 Windows desktop application (time-sheets) which i develop and wanted
I've got a .NET application that uses Remoting between an Administration Console and a
I've got a .NET 3.5 web application written in C# doing some URL rewriting
In asp.net web page got username, password, emailid from login page using session. In
I am newbie to .Net and I got a quick question. In my web
I am new to this asp net mvc but got a strong background in

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.