# DataQueryOptions Class

> DataQueryOptions class in the TX Sheet Control .NET API: Reusable query timeout/cache policy; caching is disabled by default.

- **Product:** TX Sheet Control
- **Section:** Documentation
- **Kind:** Class
- **Namespace:** `TXTextControl.TXSheetControl.Data`
- **Package:** `TXTextControl.TXSheetControl.Server` (assembly `TXTextControl.TXSheetControl.Data.dll`, from the private NuGet feed or the supplied NuGet folder)
- **Implements:** `System.IEquatable<TXTextControl.TXSheetControl.Data.DataQueryOptions>`
- **Path:** TX Sheet Control > API Reference > .NET API > TXTextControl.TXSheetControl.Data > DataQueryOptions Class
- **1311 words**
- **Web URL:** https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-data/dataqueryoptions/
- **LLMs URL:** https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-data/dataqueryoptions/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-data/dataqueryoptions/llms-full.txt

---

Reusable query timeout/cache policy; caching is disabled by default.

### Syntax

```csharp
public class DataQueryOptions
```

Interfaces: `IEquatable<DataQueryOptions>`.

### Members

#### Constructors

| Constructor | Description |
|---|---|
| [Constructor](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-data/dataqueryoptions/constructor/llms-full.txt) |  |

#### Properties

| Property | Description |
|---|---|
| [BypassCache](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-data/dataqueryoptions/bypasscache-property/llms-full.txt) | Forces a fresh query, updating the cache only after success. |
| [CacheDuration](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-data/dataqueryoptions/cacheduration-property/llms-full.txt) | Cache TTL from query completion, zero to disable, at most one hour. Up to 32 entries per query. |
| [CacheScope](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-data/dataqueryoptions/cachescope-property/llms-full.txt) | Required for caching. Host-supplied authorization/tenant scope; never trust a browser's scope. |
| [Timeout](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-data/dataqueryoptions/timeout-property/llms-full.txt) | Complete query deadline, greater than zero and at most five minutes. Default 30 seconds. |

### Examples

Create a working report from bounded HTTP sales data. Supply an application-owned HttpClient and service URL; scope cached data to its actual audience.

```csharp
using System.Net.Http;
using TXTextControl.TXSheetControl.Data;
using TXTextControl.TXSheetControl.Server;

async Task<byte[]> BuildDataQueryOptionsExampleAsync(ServerSheetControl control, HttpClient client, Uri serviceBase)
{
    var book = control.Workbook;
    var sheet = await book.Sheets.AtAsync(0);
    var source = new HttpDataSource(client, request => new HttpRequestMessage(HttpMethod.Get, new Uri(serviceBase, "sales?offset=" + request.Offset + "&limit=" + request.Limit)), ["Region", "Revenue"]);
    var registry = new DataSourceRegistry();
    registry.Register("sales-service", "regional-sales", source);

    var request = new DataRequest { Offset = 0, Limit = 100, Parameters = new Dictionary<string, object?> { ["year"] = 2026 } };
    var options = new DataQueryOptions { Timeout = TimeSpan.FromSeconds(15), CacheDuration = TimeSpan.FromMinutes(1), CacheScope = "public-regional-sales" };
    using var binding = new WorkbookDataBinding(book, registry);
    await binding.RefreshRangeAsync(sheet.Range("A1:B101"), "sales-service", "regional-sales", request, options);
    await sheet.Range("A1:B1").FormatAsync(new { fontFamily = "Liberation Sans", fontSize = 16, bold = true, textColor = "#ffffff", fillColor = "#163b63" });
    return await control.SaveAsync(StreamType.PDF);
}
```

### See Also

- [TXTextControl.TXSheetControl.Data Namespace](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-data/llms-full.txt)
- [Workbooks and Worksheets](https://docs.textcontrol.com/tx-sheet-control/spreadsheets/workbooks/llms-full.txt)

---

## In This Section

- [DataQueryOptions.BypassCache Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-data/dataqueryoptions/bypasscache-property/llms-full.txt): DataQueryOptions.BypassCache property in the TX Sheet Control .NET API: Forces a fresh query, updating the cache only after success.
- [DataQueryOptions.CacheDuration Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-data/dataqueryoptions/cacheduration-property/llms-full.txt): DataQueryOptions.CacheDuration property in the TX Sheet Control .NET API: Cache TTL from query completion, zero to disable, at most one hour.
- [DataQueryOptions.CacheScope Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-data/dataqueryoptions/cachescope-property/llms-full.txt): DataQueryOptions.CacheScope property in the TX Sheet Control .NET API: Required for caching. Host-supplied authorization/tenant scope.
- [DataQueryOptions Constructor](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-data/dataqueryoptions/constructor/llms-full.txt): DataQueryOptions constructor in the TX Sheet Control .NET API, with its syntax, a C# example and remarks on awaiting tasks and handles.
- [DataQueryOptions.Timeout Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-data/dataqueryoptions/timeout-property/llms-full.txt): DataQueryOptions.Timeout property in the TX Sheet Control .NET API: Complete query deadline, greater than zero and at most five minutes. Default 30 seconds.

---

## Nearby

- **Previous:** [TXTextControl.TXSheetControl.Data Namespace](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-data/llms-full.txt)
- **Next:** [DataQueryOptions Constructor](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-data/dataqueryoptions/constructor/llms-full.txt)
