# wire.data.DataSet

Use the `DataSet` class to combine a data source and a query to create live, interactive connections to data services.

## Properties

| Name      | Type     | Default | Description                                                                                                                                                                                              |
| --------- | -------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| DataId    | string   | guid    | The unique identifier for the data set.  This can be used with data events to listen for changes to the data set.                                                                                        |
| Events    | boolean  | true    | Determines whether the data set listens for data events.  This is often set to false for data sets bound to filters.                                                                                     |
| Query     | object   | null    | The [wire.data.TableQuery](/wirebootstrap/reference/wire.data/wire.data.datatable.md) or [wire.data.StoredProcedure](/wirebootstrap/reference/wire.data/wire.data.storedprocedure.md) that is the query. |
| Source    | object   | null    | The [wire.data.DataSource](/wirebootstrap/reference/wire.data/wire.data.datasource.md) object that is the data source.                                                                                   |
| Transform | function | null    | The callback hook for any custom data processing after the data has come back from the data service but before its broadcast to consumers including components listening for changes.                    |
| Write     | object   | null    | Sets up the data set to support writing data to a data service.  For details, visit [Writing Data](/wirebootstrap/writing-data-1.md).                                                                    |

## Methods

| Name            | Description                                                                                                                                                                                                                                                                                                                                                                              |
| --------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| cast            | Static method that casts an object with the same data set properties into an instance of the `DataSet` class.                                                                                                                                                                                                                                                                            |
| data            | Returns or sets the data inside the data set.                                                                                                                                                                                                                                                                                                                                            |
| execAsync       | Asynchronous call to execute the query against the data service defined in the data source.  Returns a [DataPromise](/wirebootstrap/reference/wire.data/wire.data.datapromise.md) but does not add it to the update stack.  This data set will not send out updates to the promise if it picks up changes.  For details visit, [Executing Queries](/wirebootstrap/executing-queries.md). |
| execAsyncListen | Functions the same as `execAsync` except it adds the [DataPromise](/wirebootstrap/reference/wire.data/wire.data.datapromise.md) to the update stack.  This data set will send out updates to the promise when it picks up changes. For details visit, [Executing Queries](/wirebootstrap/executing-queries.md).                                                                          |
| refresh         | Forces the data set to re-execute the query in the data set to bring down new data.                                                                                                                                                                                                                                                                                                      |
| table           | Helper method for TypeScript defined as `IWireDataTable`.  Returns the data inside the data set.  This method assumes the data is a [wire.data.DataTable](/wirebootstrap/reference/wire.data/wire.data.datatable.md).                                                                                                                                                                    |
| write           | Writes an array of data to the data service using the configuration in the `Write` property.  For details, visit [Writing Data](/wirebootstrap/writing-data-1.md).                                                                                                                                                                                                                       |

For details and examples on data sets, visit [Working with DataSets](/wirebootstrap/datasets.md).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.wirebootstrap.com/wirebootstrap/reference/wire.data/wire.data.dataset.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
