enumeration

Enumerated types in SQL Server 2008?

Is there some kind of mechanism in SQL Server to allow Enumerated type like functionality? For example, if I have a column Called "UpdateStatus" it usually gets setup with single letter values like so: D X U I This could equate to a lot of things. That leads to confusion. The alternative is to have it be a string column like this:...

What should be done to have 'Value' in the enumeration ?

This code does not compile: object Token extends Enumeration { type ID = Value val Key, Value = Value } error: recursive value Value needs type What should be done to have 'Value' in the enumeration ? ...

Collection was modified; enumeration operation may not execute for hashtable

I have this timer function, it gives me following exception. Collection was modified; enumeration operation may not execute once i remove the object from hashtable. what is the solution to implement similar functionality void timerFunction(object data) { lock (tMap.SyncRoot) { foreach (UInt32 id in tMap.Keys) { ...

How do I enumerate a static dictionary contained in a static class from asp.net ( aspx) page

I don't understand how to loop over a static dictionary contained in a static class from my aspx page. I have this for the static class public static class ErrorCode { public static IDictionary<int, string> ErrorCodeDic; static ErrorCode() { ErrorCodeDic = new Dictionary<int, string>() { {1, ...

How to define enum in as3?

Is there a way to define an enum in AS3 in a way we do it in other languages? I can define constants with defined values like that: private const CONST_1:int = 0; private const CONST_2:int = 1; private const CONST_3:int = 2; and so on. If I want to insert some other constant between 3 these I need to move all values like that: privat...

Enumerate possible states transition of Workflow Foundation state machine.

For GUI purposes I need by current state of state machine to enumerate possible available states of transition. For example there is transitions: A->B, A->C, B->D, C->D. Assuming state machine is in A state, so I need get list of B and C. ...

Enumerating a string

I have a status which is stored as a string of a set length, either in a file or a database. I'm looking to enumerate the possible status' I have the following type to define the possible status' Type TStatus = (fsNormal = Ord('N'),fsEditedOnScreen = Ord('O'), fsMissing = Ord('M'),fsEstimated = Ord('E'),fsSuspect = Ord...

How do I implement this public accesible enum

Hey guys, I'm trying to access my class's private enum. But I don't understand the difference needed to get it working compared to other members; If this works: private double dblDbl = 2; //misc code public double getDblDbl{ get{ return dblDbl; } } Why can I not do it with enum? private enum myEnum{ Alpha, Beta}; //misc code ...

Overriding Scala Enumeration Value

As far as I can tell, Scala has definitions for the Enumeration Value class for Value(Int), Value(String), and Value(Int, String). Does anyone know of an example for creating a new Value subclass to support a different constructor? For example, If I want to create an Enumeration with Value(Int, String, String) objects, how would I do i...

Enumeration of a complex type

How can I make an enumeration of a complex type? For example, I want to store the following data into a xsd enumeration called Measurings description tag item item tag fileName each one of these attributes has an specific value and this set makes one registry in my ennumeration. But the problem is that as far as I know, it's allo...

About enumerations in Delphi and c++ in 64-bit environments

I recently had to work around the different default sizes used for enumerations in Delphi and c++ since i have to use a c++ dll from a delphi application. One function call returns an array of structs (or records in delphi), the first element of which is an enum. To make this work, I use packed records (or aligned(1)-structs). However,...

Strange thing about .NET 4.0 filesystem enumeration functionality

I just read a page of "Whats new .NET Framework 4.0". I have trouble understanding the last paragraph: To remove open handles on enumerated directories or files Create a custom method (or function in Visual Basic) to contain your enumeration code. Apply the MethodImplAttribute attribute with the NoInlining option to the...

Enumerating all combinations of lists of different types

Given two IEnumberables of different types, what is the best practice (considering readability and maintainability) for iterating over both lists to perform an action on all possible combinations? My initial solution was to use nested foreach loops, iterating over the first IEnumerable, and then within that loop, iterating over the sec...

Cannot implicitly convert type ... to ... problem

I have this code: public static IEnumerable<dcCustomer> searchCustomer(string Companyname) { TestdbDataContext db = new TestdbDataContext(); IEnumerable<dcCustomer> myCustomerList = (from Customer res in db.Customers ...

How to handle an "infinite" IEnumerable?

A trivial example of an "infinite" IEnumerable would be IEnumerable<int> Numbers() { int i=0; while(true) { yield return unchecked(i++); } } I know, that foreach(int i in Numbers().Take(10)) { Console.WriteLine(i); } and var q = Numbers(); foreach(int i in q.Take(10)) { Console.WriteLine(i); } both work fine (and ...

soap enumeration value in php

Hi all, I want to create a soap enumeration value in php. Here is the complex object type customer and CustomerStage <complexType name="Customer"> <complexContent> <extension base="platformCore:Record"> <sequence> <element name="customForm" type="platformCore:RecordRef" minOccurs="0"/> <element name="entityId" type="xsd:string" minOccur...

Why am I getting "Collection was modified; enumeration operation may not execute" when not modifying the enumerated collection?

I have two collections of strings: CollectionA is a StringCollection property of an object stored in the system, while CollectionB is a List generated at runtime. CollectionA needs to be updated to match CollectionB if there are any differences. So I devised what I expected to be a simple LINQ method to perform the removal. var strDiffe...

Large flags enumerations in C#

Hey everyone, got a quick question that I can't seem to find anything about... I'm working on a project that requires flag enumerations with a large number of flags (up to 40-ish), and I don't really feel like typing in the exact mask for each enumeration value: public enum MyEnumeration : ulong { Flag1 = 1, Flag2 = 2, Flag...

Passing enum parameter to a case class does not work

Can someone tell me why this does not work? case class XY(enum: MyEnum) object MyEnum extends Enumeration { val OP1, OP2 = Value } Error: not found: type MyEnum ...

Fonts Script Enumeration

Dear All, I cant find a way under c# classes ( System.Text.InstalledFontCollection & System.Windows.Media.FontFamily ) to enumerate the scripts that fonts have. To be more clear, in the FontDialog Control, there is a ComboBox that lists the scripts langagues ( arabic, greek, etc.. ). how can I enumerate these values by font ? Thanks a...