/// <summary>
/// 内部保护的数据库连接类
/// </summary>
protected abstract class Provider
{
//一个静态的连接接口;
private static System.Data.IDbConnection conn;
/// <summary>
/// 构造方法,设为私有类型,是防止外部无效的引用;
/// </summary>
protected Provider()
{
System.Data.IDbCommand x=new System.Data.OleDb.OleDbCommand();
}
/// <summary>
/// 返回数据库边接类型
/// </summary>
public static DBType Type
{
get
{
return Provider.m_DBType;
}
set
{
Provider.m_DBType=value;
}
}
private static string m_ConnectionString;
private static string m_ConnectionStringSetName;
/// <summary>
/// 数据库连接字符串设置名称
/// </summary>
public static string ConnectionSetName
{
set
{
Provider.m_ConnectionStringSetName=value;
}
}
/// <summary>
/// 数据库连接字符串
/// </summary>
public static string ConnectionString
{
set
{
Provider.m_ConnectionString=value;
}
}
private static DBType m_DBType;
/// <summary>
/// 获得数据库连接接口
/// </summary>
/// <returns>返回一个连接</returns>
public static System.Data.IDbConnection getConn()
{
string ConnStr="";
try{
//System.Threading.Thread.GetDomain().UnhandledException+=new UnhandledExceptionEventHandler(ThrowDBException);
if(Provider.m_ConnectionString==""
关键词:com.joybase.DB.dll源代码(4)