I created a function that successfully reads an XML string from a recordset into a StringBuilder. The problem is that when I convert the string to XML it ends up with invalid characters and I get the error "unexpected <EOF>" trying to pass it to XSLT. I can see that there is XML in the string however. So it was suggested that we use the ExecuteXMLReader instead of the ExecuteReader method to retrieve the data and then return it as an XMLReader instead of a StringBuilder. Problem with that is that the ExecuteXMLReader always seems to return null or None where the ExecuteReader returns the XML.
Here is the code:
The returnReader has a value of null where the same process using the ExecuteReader would return the proper resultsDim returnReader as XmlReader
CONN.Open() Dim command As SqlCommand = _ BuildQueryCommand(storedProcName, parameters) ' this function just adds the parameters to the command object command.CommandType = CommandType.StoredProcedure returnReader = command.ExecuteXmlReader() Return returnReader