SQL Server Performance

Connecting analysis server from .Net

Discussion in 'SQL Server 2005 Analysis Services' started by anilvl, Feb 23, 2006.

  1. anilvl New Member

    How to connect to a cube and retrieve data on sql 2005 using .NET
  2. ranjitjain New Member

    I found this thread as unanswered so thought of replying, so it could help someone later.

    Dim ASsrv as New Microsoft.AnalysisServices.Server

    'connect to server with basic connection string including server name & provider
    ASsrv.connect(connectionstring)
    'connect to databse on that server
    Dim db as database = ASsrv.database.getbyname("DB Name")
    'connect to cube on that database
    Dim Cube as Cube =db.cubes.getbyname("Cube Name")

    Then after connecting to cube you can then get all properties for cube and then you can use this cube object to connect to any measureGroup and/or partitions.

Share This Page