ExecuteXmlReader
This method executes the command using the XmlCommandType and CommandText properties and returns the result as an XML document in a .NET XmlTextReader object.
Declaration
// C# public XmlReader ExecuteXmlReader();
Return Value
An XmlReader.
Remarks
The behavior of ExecuteXmlReader varies depending on the XmlCommandType property value:
-
XmlCommandType=OracleXmlCommandType.NoneExecuteStreamthrows anInvalidOperationException. -
XmlCommandType=OracleXmlCommandType.QueryExecuteXmlReaderexecutes the select statement in theCommandTextproperty, and if successful, returns a .NETXmlTextReaderobject containing the XML document that was generated.If the XML document is empty, which can happen if the SQL query does not return any rows, then an empty .NET
XmlTextReaderobject is returned. -
XmlCommandType=OracleXmlCommandType.Insert,OracleXmlCommandType.Update, orOracleXmlCommandType.Delete.The value of the
CommandTextproperty is an XML document, andExecuteXmlReadersaves the changes in that XML document to the table or view that is specified in theXmlSavePropertiesproperty. An empty .NETXmlTextReaderobject is returned.