public static IDatabase CreateDataBase(ConnectionStringSettings settings) { try { IDatabase database = new MySqlDataBase(settings.ConnectionString); return(database); } catch { throw new Exception("数据库连接字符串错误!"); } }
/// <summary> /// 构建数据访问组件 /// </summary> /// <returns></returns> public static IDatabase CreateDataBase() { try { IDatabase database = new MySqlDataBase(DBConnectionString); return(database); } catch (Exception ex) { throw new Exception("数据库连接字符串错误!"); } }