# DataSourceCapabilities Enumeration

> DataSourceCapabilities enumeration in the TX Sheet Control .NET API: Provider operations the host can expose. Covers its 3 values and a C# example.

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

---

Provider operations the host can expose. Aggregate pushdown can be expressed by a registered server query.

### Syntax

```csharp
public enum DataSourceCapabilities
```

Interfaces: `IComparable`, `ISpanFormattable`, `IFormattable`, `IConvertible`.

### Members

| Member | Value | Description |
|---|---|---|
| `None` | `0` |  |
| `Paging` | `2` |  |
| `Parameters` | `1` |  |

### Examples

Request a bounded snapshot from an application-provided data source, honor its paging capability and write the returned columns and rows into a report.

```csharp
using TXTextControl.TXSheetControl.Data;
using TXTextControl.TXSheetControl.Server;

async Task<byte[]> ExportProviderDataAsync(ServerSheetControl control, IDataSource source)
{
    var book = control.Workbook;
    var sheet = await book.Sheets.AtAsync(0);
    var request = new DataRequest { Limit = 100 };

    if (!source.Capabilities.HasFlag(DataSourceCapabilities.Paging)) request = new DataRequest();

    var data = await source.QueryAsync(request);

    if (data.Rows.Count == 0) return await control.SaveAsync(StreamType.PDF);

    var lastColumn = "";

    for (var index = data.Columns.Count; index > 0; index /= 26) { index--; lastColumn = (char)(65 + index % 26) + lastColumn; }

    await sheet.Range("A1:" + lastColumn + "1").SetValuesAsync([data.Columns.Cast<object?>().ToArray()]);
    await sheet.Range("A2:" + lastColumn + (data.Rows.Count + 1)).SetValuesAsync(data.Rows.Select(row => row.ToArray()).ToArray());
    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)

---

## Nearby

- **Previous:** [DataSnapshot.Rows Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-data/datasnapshot/rows-property/llms-full.txt)
- **Next:** [DataSourceRegistry Class](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-data/datasourceregistry/llms-full.txt)
