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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T13:06:11+00:00 2026-05-25T13:06:11+00:00

The enum System.TypeCode is defined as follows: public enum TypeCode { Empty = 0,

  • 0

The enum System.TypeCode is defined as follows:

public enum TypeCode
{
   Empty = 0,
   Object = 1,
   DBNull = 2,
   Boolean = 3,
   Char = 4,
   SByte = 5,
   Byte = 6,
   Int16 = 7,
   UInt16 = 8,
   Int32 = 9,
   UInt32 = 10,
   Int64 = 11,
   UInt64 = 12,
   Single = 13,
   Double = 14,
   Decimal = 15,
   DateTime = 16,
   String = 18,
}

Out of curiosity, what happened to TypeCode of value 17? Has it ever existed? Why has TypeCode.String the value of 18 and not 17?

  • 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-25T13:06:12+00:00Added an answer on May 25, 2026 at 1:06 pm

    The following blog post explains the hole:

    This is a good question. I was digging through the history of this
    file to see if I could figure out what happened, and it’s not clear.
    We’ve had this “hole” in the TypeCode enum since October of 2000, and
    I can’t find an older set of bits. But, I’m sure that comment in
    IConvertible is right – this used to be TimeSpan. For TimeSpan, it’s
    possible we thought it would be interesting for a while, then we
    realized that frankly not that many people need to convert a Decimal
    to a TimeSpan, then removed it.

    You might ask why we didn’t “fix” the enum when we removed whichever
    of these values we had originally added. It turns out that whenever we
    have a breaking change internally, we need to recompile all the code
    that might possibly depend on the removed or changed public surface
    area. For us, that would mean rebuilding everything that might have
    referred to TypeCode.String, whose value would have changed from 18 to
    17. While we do go through that process internally in DevDiv, it is
    costly & painful for us.

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

Sidebar

Related Questions

public enum myEnum { VAL1(10), VAL2(20), VAL3(hai) { public Object getValue() { return this.strVal;
I have an enum that looks as follows: public enum TransactionStatus { Open =
I have an Enum called Status defined as such: public enum Status { VALID(valid),
MSDN defines System.Enum as an abstract class: [SerializableAttribute] [ComVisibleAttribute(true)] public abstract class Enum :
I have the following enum declared: public enum TransactionTypeCode { Shipment = 'S', Receipt
I have the following enum: public enum Status implements StringEnum{ ONLINE(on),OFFLINE(off); private String status
Given the following java enum: public enum AgeRange { A18TO23 { public String toString()
I have an enum construct like this: public enum EnumDisplayStatus { None = 1,
Founded that: typeof(System.Enum).IsClass == false It's become strange that System.Enum has also .IsValueType ==
I have: ComboBox.DataSource = System.Enum.GetValues(typeof(ImageLayout)); but how do I set the ComboBox.SelectedItem to an

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.