# DataSnapshot Class

> DataSnapshot class in the TX Sheet Control .NET API: Immutable detached schema and rows, serializable as a browser data response.

- **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)
- **Path:** TX Sheet Control > API Reference > .NET API > TXTextControl.TXSheetControl.Data > DataSnapshot Class
- **930 words**
- **Web URL:** https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-data/datasnapshot/
- **LLMs URL:** https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-data/datasnapshot/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-data/datasnapshot/llms-full.txt

---

Immutable detached schema and rows, serializable as a browser data response. At most 256 columns / 250,000 cells.

### Syntax

```csharp
public class DataSnapshot
```

### Members

#### Constructors

| Constructor | Description |
|---|---|
| [Constructor](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-data/datasnapshot/constructor/llms-full.txt) | Validates and detaches all input. Rejects nested values, duplicate headers, nonfinite or unsafe integers. |

#### Properties

| Property | Description |
|---|---|
| [Columns](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-data/datasnapshot/columns-property/llms-full.txt) | Stable unique field names, in the same order as row cells. |
| [Rows](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-data/datasnapshot/rows-property/llms-full.txt) | Immutable rectangular rows of string, double, boolean or null values. Dates use ISO strings. |

### 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 TXTextControl.TXSheetControl.Data;
using TXTextControl.TXSheetControl.Server;

async Task<byte[]> BuildDataSnapshotExampleAsync(ServerSheetControl control)
{
    var book = control.Workbook;
    var sheet = await book.Sheets.AtAsync(0);
    var data = new DataSnapshot(["Region", "Revenue"], [["North", 42000], ["South", 38500]]);
    await sheet.Range("A1:B1").SetValuesAsync([data.Columns.Cast<object?>().ToArray()]);
    await sheet.Range("A2:B3").SetValuesAsync(data.Rows.Select(row => row.ToArray()).ToArray());
    await sheet.Tables.AddAsync("RegionalSales", "A1:B3", new TableOptions { Style = "TableStyleMedium2", ShowRowStripes = true });
    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

- [DataSnapshot.Columns Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-data/datasnapshot/columns-property/llms-full.txt): DataSnapshot.Columns property in the TX Sheet Control .NET API: Stable unique field names, in the same order as row cells.
- [DataSnapshot Constructor](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-data/datasnapshot/constructor/llms-full.txt): DataSnapshot constructor in the TX Sheet Control .NET API: Validates and detaches all input. Covers the parameters columns and rows and a C# example.
- [DataSnapshot.Rows Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-data/datasnapshot/rows-property/llms-full.txt): DataSnapshot.Rows property in the TX Sheet Control .NET API: Immutable rectangular rows of string, double, boolean or null values. Dates use ISO strings.

---

## Nearby

- **Previous:** [DataRequest.Parameters Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-data/datarequest/parameters-property/llms-full.txt)
- **Next:** [DataSnapshot Constructor](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-data/datasnapshot/constructor/llms-full.txt)
