954,593 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

SSAS - ADOMD.NET - Best Practices

Hi,

I'm starting with BI, Analysis Services, Cubes and ADOMD.NET.

I searched a lot and was able to make some demos, but the performance is not good.

What I'm trying to do it's a Dimension tree view explorer.

Currently I have the following code:

CubeDef cube = conn.Cubes.Find( "SCA" );
            Dimension dim =  cube.Dimensions.Find( "CLIENTE" );
            Hierarchy hrc = dim.Hierarchies.Find( "LOCAL" );

            MemberCollection estados = hrc.Levels.Find( "EST" ).GetMembers();

            StringBuilder sb = new StringBuilder();

            // Loop first level
            foreach ( Member e in estados )
            {
                sb.AppendFormat( @"<div class=""estado""><span class=""titulo"">{0}</span><div class=""cidades"">", e.Caption );

                MemberCollection cidades =  e.GetChildren();
                // Loop second level
                foreach ( Member c in cidades )
                {
                    sb.AppendFormat( @"<div class=""cidade""><span class=""titulo"">{0}</span><div class=""bairros"">", c.Caption );

                    MemberCollection bairros = c.GetChildren();
                    // Loop third level
                    foreach ( Member b in bairros )
                    {
                      sb.AppendFormat( @"<div class=""bairro"">{0}</div>", b.Caption );
                    }
                    sb.Append( "</div></div>" );
                }
                sb.Append( "</div></div>" );
            }


How can i accomplish the same result with better practices?

Thanks.

AleMonteiro
Junior Poster
164 posts since Aug 2010
Reputation Points: 15
Solved Threads: 30
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: