Using System;
Using System. Collections. Generic;
Using System. text;
Using Oracle. dataaccess. client;
Using Oracle. dataaccess. types;
Namespace Xmlprop11
{
// Demonstrate how to use the oraclexmlqueryproperties class
Class Program
{
Static Void Main ( String [] ARGs)
{
// Create the connection.
String Constr = " User ID = Scott; Password = tiger; Data Source = bjoracle) " ;
Oracleconnection Conn = New Oracleconnection (constr );
Conn. open ();
// Create the command
Oraclecommand cmd = New Oraclecommand ( "" , Conn );
// Set the XML properties directly on XML query Properties
// Of the oraclecommand object
Console. writeline ( " Set the properties directly on oraclecommand object. " );
Console. writeline ( " Set row tag to row " );
Cmd. xmlqueryproperties. rowtag = " Row " ;
Console. writeline ( " Row Tag: " + Cmd. xmlqueryproperties. rowtag );
Console. writeline ( " Set row tag to employee. " );
Cmd. xmlqueryproperties. rowtag = " Employee " ;
Console. writeline ( " Row Tag: " + Cmd. xmlqueryproperties. rowtag );
Console. writeline ( " \ N " );
// Set the XML Properties Using an oraclexmlqueryproperties object
Console. writeline ( " Set the XML Properties Using an oraclexmlqueryproperties object. " );
Oraclexmlqueryproperties qprops = New Oraclexmlqueryproperties ();
Console. writeline ( " Set row tag to row on oraclexmlqueryproperties object. " );
Qprops. rowtag = " Row " ;
Console. writeline ( " Set the new xmlquery properties on the oraclecommand. " );
Cmd. xmlqueryproperties = Qprops;
Console. writeline ( " Set the tag to employee on oraclexmlqueryproperties object. " );
Qprops. rowtag = " Employee " ;
Console. writeline ( " Row tag on oraclexmlqueryproperties object: " + Qprops. rowtag );
Console. writeline ( " Row tag on oraclecommand object: " + Cmd. xmlqueryproperties. rowtag );
Console. writeline ( " \ N " );
Console. writeline ( " Set row tag to row on oraclecommand object. " );
Cmd. xmlqueryproperties. rowtag = " Row " ;
// Clone the xmlqueryproperties from the oraclecommand object.
Console. writeline ( " Clone the xmlqueryproperties from the oraclecommand object. " );
Oraclexmlqueryproperties qpropsclone = (Oraclexmlqueryproperties) cmd. xmlqueryproperties. Clone ();
Console. writeline ( " Row tag on oraclecommand object: " + Cmd. xmlqueryproperties. rowtag );
Console. writeline ( " Row tag on cloned oraclexmlqueryproperties object: " + Qpropsclone. rowtag );
Console. writeline ( " \ N " );
// Clone the oraclecommand object.
Console. writeline ( " Clone the oraclecommand object. " );
Oraclecommand clone = (Oraclecommand) cmd. Clone ();
Console. writeline ( " Set row tag to employee on oraclecommand object. " );
Cmd. xmlqueryproperties. rowtag = " Employee " ;
Console. writeline ( " Row tag on oraclecommand object: " + Cmd. xmlqueryproperties. rowtag );
Console. writeline ( " Row tag on cloned oraclecommand object: " + Repeated clone. xmlqueryproperties. rowtag );
Console. writeline ( " \ N " );
// Clean up
Cmd. Dispose ();
Clone. Dispose ();
Conn. Close ();
Conn. Dispose ();
// Waiting
Console. Readline ();
}
}
}
Introduction to oraclexmlqueryproperties
Maximum number of rows returned by maxrows
The tag of the roottag XML document
Rowtag XML Element value description
XSLT description of XML document conversion
Xsltparams XSL document parameter description
Clone () Copy of oraclexmlqueryproperties object