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 4233798
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T02:15:58+00:00 2026-05-21T02:15:58+00:00

If I have an a dropdownlist bound to an enum, such as below, and

  • 0

If I have an a dropdownlist bound to an enum, such as below, and I take the selected value and update my database record that is expecting an int, am I going to be thought of as lazy or ignoring the point of having an enum if I don’t cast the int to the corresponding enum value first?

I should probably mention that I am working with legacy code and they are not using classes to model each object, they are just updating the record in the db directly from the UI. No need to tell me why this is bad.

public enum Schedule
{
        None = 0,
        Hourly = 1,
        Daily = 2,
        Weekly = 3,
        Monthly = 4,
}
  • 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-21T02:15:59+00:00Added an answer on May 21, 2026 at 2:15 am

    I don’t see this as lazy. The names of an enum are for our benefit. The database only cares about its value and that is what you are giving it.

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

Sidebar

Related Questions

I have a dropdownlist that is bound from a separate dropdownlist selected value, on
I am creating a website which has 1 dropdownlist that bound to Northwind database,
I have a DropDownList that is populated from a datasource. After it is bound,
I have an enum called SiteTypes that contains several values that are all bound
I have this that gets bound in my code behind: <asp:DropDownList id=ddlPopulation runat=server DataTextField=population
I have a basic DropDownList bound to a ObjectDataSource: <asp:DropDownList ID=DropDownList1 runat=server AutoPostBack=True DataSourceID=objDataSource1
I have a UserControl, containing a FormView, containing a DropDownList. The FormView is bound
I have a dropdownlist inside a gridview, that is loaded from a datasource when
I have a DropDownList bound to a DB. I also manually add to it
I have a grid view that is data bound to a dataset. In a

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.