June 2009 Entries

How do I cycle through a Collection?
Here are the 2 common patterns in .NET: GIVEN: PATTERN #1: Note: this method will work with collections that are typed, but not necessarily defined in a class which manages enumeration string itemName; for (int index = 0; index < OrderList.Count;index++) { itemName = OrderList[index].ItemName; // do stuff here } PATTERN #2 using System; using System.Collections.Generic; using System.Text; namespace AskPaulaExamples { public class Whine { // define AND dub the collection with something List<string> ......

Posted On Tuesday, June 16, 2009 9:57 AM | Comments (2)

Why Can't I compile my LINQ code?
If you're getting this message: The type 'System.Data.Linq.DataContext' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Data.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934... C:\Documents and Settings\pldital\My Documents\Visual Studio 2008\Projects\PatentableSer... ... add... System.Data.Linq as a reference to your project. I still get bit every once in awhile (read: pasting together a poc) ......

Posted On Tuesday, June 9, 2009 5:52 PM | Comments (5)