XmlConnection-.Net技术-3P代码网
繁体中文
设为首页
加入收藏
当前位置:.Net技术首页 >> XML应用 >> XmlConnection

XmlConnection

2004-10-01 08:26:10  作者:  来源:互联网  浏览次数:11  文字大小:【】【】【
简介:using System; using System.ComponentModel; using System.Data; using System.Xml; namespace System.Data.XmlClient {   public class XmlConnection : Component, IDbConnection, ICloneable &n...
关键字:XmlConnection

using System;

using System.ComponentModel;

using System.Data;

using System.Xml;

namespace System.Data.XmlClient

{

public class XmlConnection : Component, IDbConnection, ICloneable

{

// Constructors

public XmlConnection()

{

}

public XmlConnection(string connectionString)

{

_connString = connectionString;

}

////////////////////

// IDbConnection

////////////////////

// Public Properties

public string ConnectionString

{

get { return _connString; }

set { _connString = value; }

}

public int ConnectionTimeout

{

get

{

throw new InvalidOperationException("XmlClient Provider does not support this function");

}

}

public string Database

{

get

{

throw new InvalidOperationException("XmlClient Provider does not support this function");

}

}

public ConnectionState State

{

get { return _connState; }

}

// Public Methods

public IDbTransaction BeginTransaction()

{

throw new InvalidOperationException("XmlClient Provider does not support this function");

}

public IDbTransaction BeginTransaction(IsolationLevel lvl)

{

throw new InvalidOperationException("XmlClient Provider does not support this function");

}

public void ChangeDatabase(string databaseName)

{

throw new InvalidOperationException("XmlClient Provider does not support this function");

}

public void Close()

{

_doc.RemoveAll();

_connState = ConnectionState.Closed;

}

public IDbCommand CreateCommand()

{

return new XmlCommand("", this);

}

public void Open()

{

_doc.Load(_connString);

_connState = ConnectionState.Open;

}

////////////////////

// ICloneable

////////////////////

public object Clone()

{

return null;

}

////////////////////

// Internal Data Members

////////////////////

internal ConnectionState _connState = ConnectionState.Closed;

internal string _connString = "";

internal XmlDocument _doc = new XmlDocument();

}

}

责任编辑:admin
相关文章