Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Analysis Server and Reporting Services (2005)
 ADOMD not populating DataTable

Author  Topic 

TabAlleman
Starting Member

8 Posts

Posted - 2008-07-15 : 15:48:50
I am creating a .net web app in C# that uses ADOMD to populate a datatable. When I step through the code in the debugger, I can grab the text of my Command, and run it in SSAS and see the expected results.

However, if I continue stepping past where I fill the datatable, and then look at the datatable, the expected columns are all there, but there are zero rows of data.

Below is the C# code I am using to populate the DataTable. As I said, I have confirmed that the MDX does produce rows, but I can provide that as well, if needed.

Anybody see anything I'm doing wrong? Are there any settings I need to initialize on either my app or the cube to allow ADOMD to operate this way?

Any help is appreciated!

code:

            DataTable dtAMM = new DataTable();
using (AdomdConnection cnAMM = new AdomdConnection(ConnectionString))
{
cnAMM.ShowHiddenObjects = true;
if (cnAMM.State != ConnectionState.Open)
{
cnAMM.Open();
}
using (AdomdCommand cmdAMM = new AdomdCommand(sbAMMQuery.ToString(), cnAMM))
{
using (AdomdDataAdapter daAMM = new AdomdDataAdapter(cmdAMM))
{
daAMM.Fill(dtAMM);
}

}
}
   

- Advertisement -