日期:2008-07-25  浏览次数:20471 次

using System;
using System.ComponentModel;
using System.Data;
using System.XML;


namespace System.Data.XMLClient
{

  public class XMLCommand : Component, IDbCommand, ICloneable
    {
    // Constructors
    public XMLCommand()
        {
        }

    public XMLCommand(string sCommand)
    {
      _commandText = sCommand;
      _connection = null;
    }

    public XMLCommand(string sCommand, XMLConnection conn)
    {
      _commandText = sCommand;
      _connection = conn;
    }

    ////////////////////
    // IDbCommand
    ////////////////////

    // Public Properties
    public string CommandText
    {
      get { return _commandText;  }
      set { _commandText = value; }
    }

    public int CommandTimeout
    {
      get { throw new InvalidOperationException("XMLClient Provider does not support this property"); }
      set { throw new InvalidOperationException("XMLClient Provider does not support this property"); }
    }

    public CommandType CommandType
    {
      get { throw new InvalidOperationException("XMLClient Provider does not support this property"); }
      set { throw new InvalidOperationException("XMLClient Provider does not support this property"); }
    }

    public IDbConnection Connection
    {
      get { return _connection;  }
      set { _connection = (XMLConnection) value; }
    }

    public IDataParameterCollection Parameters
    {
      get { throw new InvalidOperationException("XMLClient Provider does not support this property"); }
    }

    public IDbTransaction Transaction
    {
      get { throw new InvalidOperationException("XMLClient Provider does not support this property"); }
      set { throw new InvalidOperationException("XMLClient Provider does not support this property"); }
    }

    public UpdateRowSource UpdatedRowSource
    {
      get { throw new InvalidOperationException("XMLClient Provider does not support this property"); }
      set { throw new InvalidOperationException("XMLClient Provider does not support this property"); }
    }

    // Public Methods
    publi