Argentini.Halide.H3Reader.GetXMLResult C# (CSharp) Method

GetXMLResult() public method

Read an XML result from a stored procedure. Used to bypass the 2,033 byte limit (multiple row) segmentation of XML results when simply requesting the column as a string. Reads in column 0 of all rows in the result set and appends them.
public GetXMLResult ( ) : string
return string
        public string GetXMLResult()
        {
            if (xmlResult == null)
            {
                try
                {
                    if (!dr.IsDBNull(0))
                    {
                        if (this.HasRows)
                        {
                            StringBuilder output = new StringBuilder("");

                            if (this.RowsRead > 0)
                            {
                                output.Append(this.GetString(0));
                            }

                            while (this.Read())
                            {
                                output.Append(this.GetString(0));
                            }

                            xmlResult = output.ToString();
                        }
                    }

                    else
                    {
                        xmlResult = "";
                    }
                }

                catch (Exception err)
                {
                    _lastSqlError = err;

                    xmlResult = "";
                }
            }

            return xmlResult;
        }