# ServerSheetControl.LoadTextAsync Method

> ServerSheetControl.LoadTextAsync method in the TX Sheet Control .NET API: Loads CSV, tabular XML or tabular JSON text. Data belongs in this first argument.

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

---

Loads CSV, tabular XML or tabular JSON text. Data belongs in this first argument; options contain configuration only.

### Syntax

```csharp
public Task<LoadResult> LoadTextAsync(string text, StreamType streamType, LoadOptions? options = null, CancellationToken cancellationToken = default)
```

### Parameters

| Parameter | Type | Optional | Description |
|---|---|---|---|
| `text` | `string` | No | The complete text content, encoded as UTF-8 before atomic loading. |
| `streamType` | `StreamType` | No | CSV, XML or JSON. Binary formats require LoadAsync. |
| `options` | `LoadOptions?` | Yes | Flat settings such as CsvLoadOptions or TabularLoadOptions; no data or format wrappers. |
| `cancellationToken` | `CancellationToken` | Yes | Cancels the operation before it replaces the workbook. |

### Return Value

`Task<LoadResult>`.

### Examples

Load CSV text directly with flat settings, format its header and exchange the processed values as JSON.

```csharp
using TXTextControl.TXSheetControl.Server;

async Task<byte[]> ImportCustomerTextAsync(ServerSheetControl control)
{
    await control.LoadTextAsync("Customer;Amount\nMüller;125,5",StreamType.CSV,new CsvLoadOptions{Delimiter=";",DecimalSeparator=",",SheetName="Orders"});

    var sheet=await control.Workbook.Sheets.GetAsync("Orders");
    await sheet.Range("A1:B1").FormatAsync(new {bold=true});
    return await control.SaveAsync(StreamType.JSON,new JsonSaveOptions{Pretty=true});
}
```

### Remarks

Use the member with an instance or settings object from the documented package. Await task-returning operations. Document-bound handles must be resolved again after loading or deleting their owner.

### See Also

- [ServerSheetControl Class](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/serversheetcontrol/llms-full.txt)
- [Loading and Saving Workbooks](https://docs.textcontrol.com/tx-sheet-control/document-processing/load-save/llms-full.txt)
- [LoadOptions Class](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/loadoptions/llms-full.txt)
- [LoadResult Class](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/loadresult/llms-full.txt)
- [StreamType Enumeration](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/streamtype/llms-full.txt)

---

## Nearby

- **Previous:** [ServerSheetControl.LoadAsync Method](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/serversheetcontrol/loadasync-method/llms-full.txt)
- **Next:** [ServerSheetControl.MergeAsync Method](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/serversheetcontrol/mergeasync-method/llms-full.txt)
