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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T08:40:25+00:00 2026-05-13T08:40:25+00:00

I want a field in a table of SQL Server 2008 to contain a

  • 0

I want a field in a table of SQL Server 2008 to contain a preset number of string values for user to be able then to select one value from a dropdown listbox in my WPF front-end app.

Is it possible only through assigning a numeric int type in a SQL Server table field and then doing all the stuff through C# front-end coding, or are there other ways?

  • 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-13T08:40:26+00:00Added an answer on May 13, 2026 at 8:40 am

    There are two different ways you could do this (well, two that come to my mind). Neither are specific to Sql Server.

    First, is to create a table which holds the values that go into the dropdown. This would be a very simple table such as

    DayOfWeek
    Name varchar(9) PK

    and then reference it in other tables via a foreign key relationship

    Hours
    Id UniqueIdentifier PK
    Day varchar(9) FK
    …

    The other way is to define an enum in your application

    public enum DayOfWeek { Monday, Tuesday, Wednesday, /*etc*/ }
    

    and then save this as an int in your database (yes, you could use a different data type):

    Hours
    Id UniqueIdentifier PK
    Day Int
    …

    If you expect the list to fluctuate at all, the first technique is better. If you expect the list to be static, the second one is usually easier to deal with in code.

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

Sidebar

Related Questions

I have a field in my SQL Server 2008 table that is auto number
I am using SQL Server 2008 and I want to show 1 single field
I have a staging table (in SQL SERVER 2008) with nullable fields. I want
I want to return all rows from a SQL Server 2008 database table into
I have a SQL Server 2008 R2 table with nvarchar(4000) field. Data that stores
My SQL Server 2008 database table has a XML field. I would like to
I have a table in MS SQL Server 2008 with a varchar column called
I am using SQL Server 2008. I have a Student table in which there
I have my own database (SQL Server 2008 RQ) and i have a table
Let's assume there is a SQL Server 2008 table like below, that holds 10

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.