Skip to main content

This is documentation for Caché & Ensemble. See the InterSystems IRIS version of this content.

For information on migrating to InterSystems IRIS, see How to Migrate to InterSystems IRIS, available on the WRC Distributions page (login required).

Collections: Lists

Here is an example of .NET code for iterating through the elements of the projection of a Caché list collection. In this case, the Caché list contains %String instances. It projects to a CacheListOfStrings object.

  Provider.Collections coll = Provider.Collections.OpenId(cnCache, "1");
  CacheListOfStrings stringList = coll.ListOfStrings;
  foreach (string str in stringList)
    Console.WriteLine("String: {0}", str);
catch(CacheException e){}

Note that cnCache represents an open CacheConnection instance.