Databases Reference
In-Depth Information
.
Level.GetMembers(long start, long count) returns number of members specified
by <count> parameter, starting at start member.
.
Level.GetMembers(long start, long count, params MemberFilter [] filters)
returns number of members specified by <count> parameter, starting at start
member and limited by the filter s.
.
Level.GetMembers(long start, long count, string [] properties, params
MemberFilter [] filters) . In addition to filtering, the client application can
specify which MemberProperties should be returned by the server.
.
Member. GetChildren() returns all children of a member, with a limited set of prop-
erties.
.
Member. GetChildren(long start, long count) returns number of child members
specified by <count> parameter, starting with start member. count is the maximum
number of returned members.
.
Member. GetChildren(long start, long count, params MemberFilter []
filters) returns number of child members specified by <count> parameter, starting
with start member and limited by the filters .
.
Member. GetChildren(long start, long count, string [] properties, params
MemberFilter [] filters) , in addition to applying the filter, specifies which prop-
erties of the member should be requested from the server.
We are now going to give you some examples that show how each of these functions
works. Listing 33.6 returns all the members of the Store level, but the collection
MemberProperty remains empty until further operations by the client application. We talk
about that later in the “Handling Object Symmetry” section.
LISTING 33.6 Level.GetMembers()
//Open a connection to the server.
AdomdConnection con = new AdomdConnection();
con.ConnectionString = “Datasource=localhost; Initial Catalog=Foodmart 2008;”;
con.Open();
//Go to the level.
Level lvl = con.Cubes[“Warehouse and Sales”].Dimensions[“Store”].
Hierarchies[“Stores”].Levels [“Store”];
//Receive a collection of the members of the level.
MemberCollection allMembers = lvl.GetMembers();
//Print all the elements of the collection.
foreach(Member member in allMembers)
{
Console.WriteLine(member.UniqueName + “;”);
Search WWH ::




Custom Search