Re: how to parse an Enum Structure in vb.net

Tech-Archive recommends: Fix windows errors by optimizing your registry



Storing the integer value rather than the name does perform better. Storing the names is something that should be considered in some cases, though.

In some cases the names correspond naturally to a number that won't change, for an example the months that are numbered from 1 through 12. Then there is no reason to store the name instead of the number.

In other cases the names have no natural numbering at all, then it might be better to store the names. The numbers are only used internally by the application, and the data in the database is meningful without a translation table.

Dennis wrote:
It seems a waste to use strings as opposed to integers in a database for ENUMS. You can just as easily assign numbers to each enum value, i.e.,

Enum Month
January = 10
February = 20
March = 30
. . .

In the new enum;
Enum Month
January = 10
February =20
Filibuster = 25
March =30
. . .

.



Relevant Pages

  • Re: Java 5.0 Enum: why not valueOf(int ordinal)?
    ... > had you used the string values, ... > your enum is never going to change, using the ordinal may be suitable. ... Storing the string values would be a lot more ... > enum Ints { ...
    (comp.lang.java.programmer)
  • Re: Java 5.0 Enum: why not valueOf(int ordinal)?
    ... On the other hand, had you used the string values, all would be well. ... If you *know* that your enum is never going to change, using the ordinal may be suitable. ... Storing the string values would be a lot more ...
    (comp.lang.java.programmer)
  • Re: Web Service State
    ... Caching is the way we have gone with this, storing each settings class using ... users store the session state. ... - Store state on the server and uniquely identify each visitor. ... We use windows authentication to authorise users to our web service, ...
    (microsoft.public.dotnet.framework.webservices)
  • Re: Reading in a file into a Linked List - Segmentation Fault
    ... > Victor Bazarov wrote: ... >> Here you store that address. ... >> which in itself can take all fun out of studying pointers. ... So, it's not storing _values_, it's storing ...
    (comp.lang.cpp)
  • Re: Store private key in cookie?
    ... Storing a key in a file somewhere is generally not a good idea, ... this is not secure) store it in the session object. ... > I was thinking of using RSA to encrypt the Rijndael key/IV. ... > private key in a cookie on a trusted 'admin' machine. ...
    (microsoft.public.dotnet.security)