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