ExecuteXMLReader Problem

I am trying to use the AdomdClient.ADOmdCommand.ExecuteXmlReader method in c# to retrieve OLAP data into an XMLReader, then write an XML file containing the data. The problem is the resulting XML document appears to be incomplete. Am I missing a parameter It doesn't matter how large the resulting data is, there is always a stopping point in the middle of the XML data.

Here is an example of what I am trying to do. Any help you can provide would be greatly appreciated. - Wendell G

Microsoft.AnalysisServices.AdomdClient.AdomdCommand adoMdCommand = new Microsoft.AnalysisServices.AdomdClient.AdomdCommand();

Microsoft.AnalysisServices.AdomdClient.AdomdConnection adoMdConnection = new Microsoft.AnalysisServices.AdomdClient.AdomdConnection();

adoMdConnection.ConnectionString = connstr;

adoMdConnection.Open();

adoMdCommand.Connection = adoMdConnection;

adoMdCommand.CommandText = mdxQuery;

System.Xml.XmlReader xmlReader = adoMdCommand.ExecuteXmlReader();

System.Xml.XmlDocument xmlDocument = new System.Xml.XmlDocument();

xmlDocument.Load(xmlReader);

string xmlFilename = "C:\\MeasureData.xml";

// Create FileStream

System.IO.FileStream fsWriteXml = new System.IO.FileStream

(xmlFilename, System.IO.FileMode.Create);

//Create an XmlTextWriter to write the file.

System.Xml.XmlTextWriter xmlWriter = new System.Xml.XmlTextWriter

(fsWriteXml, System.Text.Encoding.Unicode);

// Use WriteXml to write the document.

xmlDocument.WriteTo(xmlWriter);

//// Close the FileStream.

fsWriteXml.Close();



Answer this question

ExecuteXMLReader Problem

  • ExecuteXMLReader Problem