/// <summary> /// 用于得到数据库通用访问接口 /// </summary> /// <param name="Type">数据库访问类型</param> /// <returns></returns> public static IDatabase GetDBAccess(AccessDBType type) { IDatabase DBAccess = null; switch (type) { case AccessDBType.SQL: DBAccess = new SqlDatabase(); break; case AccessDBType.Oracle: DBAccess = new OracleDatabase(); break; } return(DBAccess); }
/// <summary> /// 用于得到数据库通用访问接口 /// </summary> /// <param name="connectionString">连接字符串</param> /// <param name="Type">数据库访问类型</param> /// <returns></returns> public static IDatabase GetDBAccess(string connectionString, AccessDBType type) { IDatabase DBAccess = null; switch (type) { case AccessDBType.SQL: DBAccess = new SqlDatabase(connectionString); break; case AccessDBType.Oracle: DBAccess = new OracleDatabase(connectionString); break; } return(DBAccess); }