using System;
using System.Text;
namespace Common.Data
{
///
/// 功能:数据连接信息
/// 作者:王昊昇
/// 时间:2012.2.8
///
public class ConnectionInfo : IDisposable
{
///
/// 数据源连接
///
public System.Data.IDbConnection Connection { get; set; }
///
/// 数据源连接状态
///
public ConnectionStatus ConnectionStatus { get; set; }
///
/// 请求数据连接的用户信息
///
public ConnectionUser ConnectionUser { get; set; }
///
/// 已使用次数
///
public int UsedFrequence { get; set; }
///
/// 数据连接编号
///
public string ID { get; set; }
///
/// 释放所有资源
///
public void Dispose()
{
ConnectionStatus = ConnectionStatus.Closed;
if (Connection != null)
{
if (Connection.State == System.Data.ConnectionState.Open)
{
Connection.Close();
}
Connection.Dispose();
Connection = null;
}
ConnectionUser = null;
UsedFrequence = 0;
}
}
}