/// <summary> /// 获取数据库操作对象 /// </summary> /// <param name="connectInfo"></param> /// <returns></returns> private BaseDbActionService GetDbConnection(ConnectInfo connectInfo) { if (HasConnect(connectInfo)) { connectInfo = GetConnectInfo(connectInfo); return(connectInfo.DbService); } connectInfo.DbService = DataBaseFactory.DbServerFactory(connectInfo); AddConnectionInfo(connectInfo); return(connectInfo.DbService); }
private SqlDataBaseService.sqlAction.BaseDbActionService GetDbConnection(SqlDataBaseService.ConnectInfo connectInfo) { bool flag; SqlDataBaseService.sqlAction.BaseDbActionService service; if ((this.HasConnect(connectInfo) == 0) == null) { goto Label_0026; } connectInfo.DbService = DataBaseFactory.DbServerFactory(connectInfo); this.AddConnectionInfo(connectInfo); Label_0026: connectInfo = this.GetConnectInfo(connectInfo); service = connectInfo.DbService; Label_0038: return(service); }
/// <summary> /// 根据数据库连接信息创建连接操作对象 /// </summary> /// <param name="settings"></param> /// <returns></returns> public static BaseDbActionService GetDBByConnectionStringSettings(ConnectionStringSettings settings) { return(CreateNewDbAction(DataBaseFactory.Factory(settings))); }
/// <summary> /// 获取当前数据库连接操作对象 /// </summary> /// <returns></returns> public static BaseDbActionService CurrentDB() { return(CreateNewDbAction(DataBaseFactory.Factory(AppConfigManage.CurrentDb()))); }