Search code examples
c#ssasxmla

How to get the list of databases in an analysis services using xmlaclient in c#


I connected to a particular server in c# using xmlaClient object. Now i want to list out the all databases in that particaular server. how to implement that. Please help me.

Thanks


Solution

  • You can use the discover method with the connection object. the code snippet as follows

    XmlaClient xmlConn = new XmlaClient();
    xmlConn.Discover("DBSCHEMA_CATALOGS", "", "", out outParam, false, false, false);
    

    it gives all the list of databases in a xml format. now you can retrieve databases in that xml by using the linq to xml concepts.