protected FbService() { this.state = FbServiceState.Closed; this.connectionString = string.Empty; this.serviceName = "service_mgr"; this.queryBufferSize = IscCodes.MAX_BUFFER_SIZE; }
protected void Open() { if (this.state != FbServiceState.Closed) { throw new InvalidOperationException("Service already Open."); } if (this.csManager.UserID == null || this.csManager.UserID.Length == 0) { throw new InvalidOperationException("No user name was specified."); } if (this.csManager.Password == null || this.csManager.Password.Length == 0) { throw new InvalidOperationException("No user password was specified."); } try { if (this.svc == null) { // New instance for Service handler this.svc = ClientFactory.CreateServiceManager(this.csManager); } // Initialize Services API this.svc.Attach(this.BuildSpb(), this.csManager.DataSource, this.csManager.Port, this.serviceName); this.state = FbServiceState.Open; } catch (Exception ex) { throw new FbException(ex.Message, ex); } }
protected FbService(string connectionString = null) { _state = FbServiceState.Closed; _serviceName = "service_mgr"; _queryBufferSize = IscCodes.DEFAULT_MAX_BUFFER_SIZE; ConnectionString = connectionString; }
/// <include file='Doc/en_EN/FbService.xml' path='doc/class[@name="FbService"]/constructor[@name="ctor"]/*'/> protected FbService() { this.csManager = new FbConnectionString(true); this.state = FbServiceState.Closed; this.connectionString = String.Empty; this.serviceName = "service_mgr"; this.queryBufferSize = 1024; }
/// <include file='Doc/en_EN/FbService.xml' path='doc/class[@name="FbService"]/method[@name="Open"]/*'/> protected void Open() { if (this.state != FbServiceState.Closed) { throw new InvalidOperationException("Service already Open."); } if (this.csManager.UserID == null || this.csManager.UserID.Length == 0) { throw new InvalidOperationException("No user name was specified."); } if (this.csManager.Password == null || this.csManager.Password.Length == 0) { throw new InvalidOperationException("No user password was specified."); } try { if (this.svc == null) { // New instance for Service handler this.svc = ClientFactory.CreateServiceManager(this.csManager.ServerType); } // Set service name string service = String.Empty; switch (this.csManager.ServerType) { case 0: service = this.csManager.DataSource + ":" + serviceName; break; default: service = serviceName; break; } // Initialize Services API this.svc.Attach(this.BuildSpb(), this.csManager.DataSource, this.csManager.Port, service); this.state = FbServiceState.Open; } catch (IscException ex) { throw new FbException(ex.Message, ex); } }
protected void Close() { if (this.state != FbServiceState.Open) { return; } try { this.svc.Detach(); this.svc = null; this.state = FbServiceState.Closed; } catch (Exception ex) { throw new FbException(ex.Message, ex); } }
protected FbService() { this.state = FbServiceState.Closed; this.connectionString = string.Empty; this.serviceName = "service_mgr"; this.queryBufferSize = IscCodes.DEFAULT_MAX_BUFFER_SIZE; }