Getting Values and Keys out of a Hashtable

Posted by: Rick Strahls WebLog, on 05 Jan 2006 | View original | Bookmarked: 0 time(s)

This sounds silly but I was doing looping through a Hashtable and scratching my head on how to get the KEYS from the table when using foreach. If you ever look at the various ICollection or IDictionary derived classes you’ll find that they all have Keys and Values collections but you can’t do anything useful with them to retrieve the key.   After my brain block of a few minutes lifted, I remembered that the raw Enumerators let you get at the data, but this isn’t the first time...

Advertisement
Free Agile Project Management Tool from Telerik
TeamPulse Community Edition helps your team effectively capture requirements, manage project plans, assign and track work, and most importantly, be continually connected with each other.
Category: ASP.NET | Other Posts: View all posts by this blogger | Report as irrelevant | View bloggers stats | Views: 3880 | Hits: 819

Similar Posts

  • Telerik Releases New Controls for Silverlight 3 and WPF more
  • Don’t use Response.End() with OutputCache more
  • Rewards, loyalty, and simple convenience more
  • Donut Hole Caching in ASP.NET MVC more
  • Outlook Send Mail Infinite Loop Message in Outbox more
  • Developing RESTful services with JSON and POX support in the ASP.NET MVC more
  • Kobe - Oh Dear Lord Why?! more
  • I can’t find my Find Dialog in Visual Studio more
  • Using Search Folders in Outlook 2007 for GTD more
  • Script to Inventory Print Servers more

News Categories

.NET | Agile | Ajax | Architecture | ASP.NET | BizTalk | C# | Certification | Data | DataGrid | DataSet | Debugger | DotNetNuke | Events | GridView | IIS | Indigo | JavaScript | Mobile | Mono | Patterns and Practices | Performance | Podcast | Refactor | Regex | Security | Sharepoint | Silverlight | Smart Client Applications | Software | SQL | VB.NET | Visual Studio | W3 | WCF | WinFx | WPF | WSE | XAML | XLinq | XML | XSD