(Original) ODP. Net demonstrate how to use the oraclexmlqueryproperties class

Source: Internet
Author: User
Tags oracleconnection

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.