# DataConnections Class

> DataConnections class in the TX Sheet Control JavaScript API for Node.js: Optional connection manager. Private state is inaccessible at runtime.

- **Product:** TX Sheet Control
- **Section:** Documentation
- **Kind:** Class
- **Path:** TX Sheet Control > API Reference > JavaScript API > Node.js Server > DataConnections Class
- **757 words**
- **Web URL:** https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/nodejs/dataconnections/
- **LLMs URL:** https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/nodejs/dataconnections/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/nodejs/dataconnections/llms-full.txt

---

Optional connection manager. Private state is inaccessible at runtime; no global namespace is installed. One provider per logical connection, multiple bindings per query. Re-registering cancels obsolete refreshes. Loading cancels requests and clears bindings; register bindings again for the new document. Dispose on host teardown.

Package: `@txtextcontrol/tx-sheet-control-server`. Version: **2.0.0**.

ES module import: `import { DataConnections } from '@txtextcontrol/tx-sheet-control-server';`.

### Constructor

```javascript
new DataConnections(workbook)
```

| Parameter | Type | Optional | Description |
|---|---|---|---|
| `workbook` | `DataWorkbook` | No | Value matching workbook's declared type and the owning object's validation rules. |

Returns: `DataConnections`.

### Members

#### Methods

| Method | Description |
|---|---|
| [bind](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/nodejs/dataconnections/bind-method/llms-full.txt) | Installs a detached binding. It does not fetch until refresh is called. |
| [dispose](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/nodejs/dataconnections/dispose-method/llms-full.txt) | Stops polling and cancels all queries. This instance cannot be reused. |
| [onChange](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/nodejs/dataconnections/onchange-method/llms-full.txt) | Subscribes to lifecycle notifications; returns an unsubscribe function. |
| [refresh](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/nodejs/dataconnections/refresh-method/llms-full.txt) | Fetches and validates a complete snapshot before writing. Latest refresh wins; failures preserve old data. Errors are returned to the host, which controls user-visible diagnostics. A timeout rejects with AbortError. |
| [refreshAll](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/nodejs/dataconnections/refreshall-method/llms-full.txt) | Refreshes all bindings independently; one rejected source does not prevent the others from updating. |
| [register](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/nodejs/dataconnections/register-method/llms-full.txt) | Registers a transport; replacing it cancels requests using the previous transport. |
| [start](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/nodejs/dataconnections/start-method/llms-full.txt) | Starts nonoverlapping polling, default 30 seconds, with at least one second between completed rounds. |
| [stop](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/nodejs/dataconnections/stop-method/llms-full.txt) | Stops polling; manual refreshes remain available. In-flight requests can complete. |
| [unbind](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/nodejs/dataconnections/unbind-method/llms-full.txt) | Removes a runtime binding and cancels its request. Existing workbook data remains. |

### Examples

Pass the DataConnections value obtained from its owning control, collection, callback or operation. The function reads that value without constructing a replacement document object.

```javascript
function inspectDataConnections(dataConnections) {
    const value = dataConnections;
    console.log('DataConnections.value', value);
}
```

### See Also

- [JavaScript Node.js Server API](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/nodejs/llms-full.txt)
- [Workbooks and Worksheets](https://docs.textcontrol.com/tx-sheet-control/spreadsheets/workbooks/llms-full.txt)

---

## In This Section

- [DataConnections.bind Method](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/nodejs/dataconnections/bind-method/llms-full.txt): DataConnections.bind method in the TX Sheet Control JavaScript API for Node.js: Installs a detached binding. It does not fetch until refresh is called.
- [DataConnections.dispose Method](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/nodejs/dataconnections/dispose-method/llms-full.txt): DataConnections.dispose method in the TX Sheet Control JavaScript API for Node.js: Stops polling and cancels all queries. This instance cannot be reused.
- [DataConnections.onChange Method](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/nodejs/dataconnections/onchange-method/llms-full.txt): DataConnections.onChange method in the TX Sheet Control JavaScript API for Node.js: Subscribes to lifecycle notifications; returns an unsubscribe function.
- [DataConnections.refresh Method](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/nodejs/dataconnections/refresh-method/llms-full.txt): DataConnections.refresh method in the Node.js JavaScript API: Fetches and validates a complete snapshot before writing. Latest refresh wins.
- [DataConnections.refreshAll Method](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/nodejs/dataconnections/refreshall-method/llms-full.txt): DataConnections.refreshAll method in the Node.js JavaScript API: Refreshes all bindings independently. Includes the syntax and a JavaScript example.
- [DataConnections.register Method](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/nodejs/dataconnections/register-method/llms-full.txt): DataConnections.register method in the TX Sheet Control JavaScript API for Node.js: Registers a transport. Includes the syntax and a JavaScript example.
- [DataConnections.start Method](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/nodejs/dataconnections/start-method/llms-full.txt): DataConnections.start method in the TX Sheet Control JavaScript API for Node.js, with its syntax and a JavaScript example.
- [DataConnections.stop Method](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/nodejs/dataconnections/stop-method/llms-full.txt): DataConnections.stop method in the Node.js JavaScript API: Stops polling; manual refreshes remain available. In-flight requests can complete.
- [DataConnections.unbind Method](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/nodejs/dataconnections/unbind-method/llms-full.txt): DataConnections.unbind method in the TX Sheet Control JavaScript API for Node.js: Removes a runtime binding and cancels its request.

---

## Nearby

- **Previous:** [DashboardCollection.setMode Method](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/nodejs/dashboardcollection/setmode-method/llms-full.txt)
- **Next:** [DataConnections.bind Method](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/nodejs/dataconnections/bind-method/llms-full.txt)
