I've the following code. It's pretty simple. First connect to ssas via http and than get the cube list. It works good until i restart my machine. After restart i get a strange exception (UnknownadomdException) like : incorect data format, and of course i have not the cube list at the end.
But, when after restart i run the Excel i'm able to connect to my ssas with the same connection parameters. After this i can also connect to my ssas in my code.
Do u have any idea?
List<string> cubeList = new List<string>();
using (AdomdConnection conn = new AdomdConnection(@"Provider=MSOLAP.4;Persist Security Info=True;User ID=domain.local\userolap;Password=pass;Initial Catalog=ssas;Data Source=http://ssas-server.pl/directory/msmdpump.dll; MDX Compatibility=1;Safety Options=2;MDX Missing Member Mode=Error"))
{
try
{
conn.Open();
foreach (var cube in conn.Cubes)
{
if (cube.Name.StartsWith("$")) continue;
cubeList.Add(cube.Name);
}
}catch (AdomdException exc)
{
MessageBox.Show(exc.Message);
}
}
}
Thank you for your time.