Geeks With Blogs
Brian Schroer Don't Call Me Mort! December 2007 Entries
Enum.GetValues and Enum.GetNames return arrays sorted by value
If you ran this code: private enum FieldWidths{ CustomerNumber = 5, OrderNumber = 10, City = 30, State = 2, Zip = 11 } . . . int[] vals = (int[])Enum.GetValues(typeo... names = Enum.GetNames(typeof(FieldW... ...you might expect (I did, anyway) that the resulting arrays would look like this: vals: 5, 10, 30, 2, 11 names: "CustomerNumber", "OrderNumber", "City", "State", "Zip" What you would get, though, is: vals: 2, 5, 10, 11, 30 names: "State", "CustomerNumber", "OrderNumber", ......

Posted On Tuesday, December 18, 2007 8:13 AM

Copyright © Brian Schroer | Powered by: GeeksWithBlogs.net