Possible bug in AdomdDataReader??

T

Troy Buehner

Hi, I'm having problems with the AdomdDataReader's Read() Method.
I'm trying to get a large query back from a cube and it seems to blow up
after it reads a large amount of records(between 2,221,588 - 2,221,592
usually).

The exception I got was this:

Index was outside the bounds of the array.

Here's the stack trace I got out of the exception:

" at System.Xml.XmlScanner.GetChar(Int32 offset) at
System.Xml.XmlTextReader.SetElementValues() at
System.Xml.XmlTextReader.ParseElement() at
System.Xml.XmlTextReader.Read() at
Microsoft.AnalysisServices.AdomdClient.XmlaXmlTextReader.Read() at
System.Xml.XmlReader.MoveToContent() at
Microsoft.AnalysisServices.AdomdClient.XmlaXmlTextReader.MoveToContent()
at System.Xml.XmlReader.IsStartElement() at
Microsoft.AnalysisServices.AdomdClient.XmlaXmlTextReader.IsStartElement()
at
Microsoft.AnalysisServices.AdomdClient.AdomdDataReader.SequentialReadXmlValue(Int32
ordinal) at
Microsoft.AnalysisServices.AdomdClient.AdomdDataReader.GetRowXmlValues(Object[]
xmlValues) at
Microsoft.AnalysisServices.AdomdClient.AdomdDataReader.Read() at
Microsoft.GotDotNet.MdxWorkbench.MainForm.btnAdoReaderDbg_Click(Object
sender, EventArgs e) in c:\\documents and
settings\\troyb.firesteel\\desktop\\mdxworkbenchnet\\cubebrowser\\mdxquery.cs

So I went in with Anakrino and decompiled the
System.XmlScanner.GetChar(Int32 offset) method
which has a single line of code:

return this._achText[offset - this._nAbsoluteOffset];

Where _achText is a char[] that I believe is causing the exception.

Here's my code snippet:

object[] objects=new object[adoreader.FieldCount];

this.m_numRecs=0;
//Read our results
try
{
while(adoreader.Read()) //Line where exception occurs
{
adoreader.GetValues(objects);

StringBuilder sb=new StringBuilder();

foreach(object o in objects)
{
if(o==null)
{
sb.Append("(null)");
}
else
{
sb.Append(o.ToString());
}
sb.Append(",");
}

//Remove last comma from the string
sb.Remove(sb.Length-1,1);

//Write the string out to disk
sw.WriteLine(sb.ToString());

this.m_numRecs++;
}
}
catch(Exception ex)
{
string zz=ex.Message;
}

adoreader.Close();

Basically I'm taking a row from the AdomdDataReader and writing it out
to a comma delimited file because the results I receive will be too big
to fit into memory all at once. I believe I'm using the latest beta
build of AdoMD.Net dated 6-18-03. At first I thought it was our data,
but I'm seeing different values for the number of records I'm at when it
exceptions at the adoreader.Read() method. Anybody have any ideas or
know of a bug in the adomddatareader that might be causing this ?

Thanks,

Troy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top