protected override void SendCreateToBuffer(DatabaseParameterBuffer dpb, string database) { this.Write(IscCodes.op_create); this.Write(0); dpb.Append(IscCodes.isc_dpb_utf8_filename, 0); this.WriteBuffer(Encoding.UTF8.GetBytes(database)); this.WriteBuffer(dpb.ToArray()); }
protected override void SendAttachToBuffer(DatabaseParameterBuffer dpb, string database) { // Attach to the database this.Write(IscCodes.op_attach); this.Write(0); // Database object ID dpb.Append(IscCodes.isc_dpb_utf8_filename, 0); this.WriteBuffer(Encoding.UTF8.GetBytes(database)); // Database PATH this.WriteBuffer(dpb.ToArray()); // DPB Parameter buffer }
public void Attach(DatabaseParameterBuffer dpb, string dataSource, int port, string database) { lock (this) { byte[] databaseBuffer = Encoding.Default.GetBytes(database); int dbHandle = 0; // Clear status vector ClearStatusVector(); _fbClient.isc_attach_database( _statusVector, (short)databaseBuffer.Length, databaseBuffer, ref dbHandle, (short)dpb.Length, dpb.ToArray()); ParseStatusVector(_statusVector); // Update the database handle _handle = dbHandle; // Get server version _serverVersion = GetServerVersion(); } }
public void CreateDatabase(DatabaseParameterBuffer dpb, string dataSource, int port, string database) { lock (this) { byte[] databaseBuffer = Encoding.Default.GetBytes(database); int dbHandle = Handle; // Clear status vector ClearStatusVector(); _fbClient.isc_create_database( _statusVector, (short)databaseBuffer.Length, databaseBuffer, ref dbHandle, (short)dpb.Length, dpb.ToArray(), 0); ParseStatusVector(_statusVector); _handle = dbHandle; Detach(); } }
protected virtual void SendCreateToBuffer(DatabaseParameterBuffer dpb, string database) { this.Write(IscCodes.op_create); this.Write(0); this.WriteBuffer(Encoding.Default.GetBytes(database)); this.WriteBuffer(dpb.ToArray()); }
protected virtual void SendAttachToBuffer(DatabaseParameterBuffer dpb, string database) { // Attach to the database this.Write(IscCodes.op_attach); this.Write(0); // Database object ID this.WriteBuffer(Encoding.Default.GetBytes(database)); // Database PATH this.WriteBuffer(dpb.ToArray()); // DPB Parameter buffer }
public void Attach(DatabaseParameterBuffer dpb, string dataSource, int port, string database) { lock (this) { try { this.connection.Connect(dataSource, port, this.packetSize, this.charset); this.Identify(database); this.Send.Write(IscCodes.op_attach); this.Send.Write((int)0); // Database object ID this.Send.Write(database); // Database PATH this.Send.WriteBuffer(dpb.ToArray()); // DPB Parameter buffer this.Send.Flush(); try { this.handle = this.ReadGenericResponse().ObjectHandle; } catch (IscException) { try { this.connection.Disconnect(); } catch { } throw; } } catch (IOException) { this.connection.Disconnect(); throw new IscException(IscCodes.isc_net_write_err); } // Get server version this.serverVersion = this.GetServerVersion(); } }
public void CreateDatabase(DatabaseParameterBuffer dpb, string dataSource, int port, string database) { lock (this) { try { this.connection.Connect(dataSource, port, this.packetSize, this.charset); this.Send.Write(IscCodes.op_create); this.Send.Write((int)0); this.Send.Write(database); this.Send.WriteBuffer(dpb.ToArray()); this.Send.Flush(); try { this.handle = this.ReadGenericResponse().ObjectHandle; this.Detach(); } catch (IscException) { try { this.connection.Disconnect(); } catch (Exception) { } throw; } } catch (IOException) { throw new IscException(IscCodes.isc_net_write_err); } } }
public void Attach(DatabaseParameterBuffer dpb, string dataSource, int port, string database) { lock (this) { int[] statusVector = FesConnection.GetNewStatusVector(); int dbHandle = 0; FbClient.isc_attach_database( statusVector, (short)database.Length, database, ref dbHandle, (short)dpb.Length, dpb.ToArray()); this.handle = dbHandle; this.ParseStatusVector(statusVector); // Get server version this.serverVersion = this.GetServerVersion(); } }
public void CreateDatabase(DatabaseParameterBuffer dpb, string dataSource, int port, string database) { lock (this) { int[] statusVector = FesConnection.GetNewStatusVector(); int dbHandle = this.Handle; FbClient.isc_create_database( statusVector, (short)database.Length, database, ref dbHandle, (short)dpb.Length, dpb.ToArray(), 0); this.ParseStatusVector(statusVector); this.handle = dbHandle; this.Detach(); } }