# SortingInstruction Constructor

> Initializes a new instance of the SortingInstruction class.

- **Product:** TX Text Control .NET for Windows Forms
- **Section:** Reference
- **Kind:** Constructor
- **Introduced:** 26.0
- **Namespace:** `TXTextControl.DocumentServer.DataShaping`
- **Package:** `TXTextControl.TextControl.WinForms.SDK` (assembly `TXDocumentServer.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXDocumentServer.dll` from the setup
- **Path:** TX Text Control .NET for Windows Forms > Reference > TXTextControl.DocumentServer.DataShaping > SortingInstruction Constructor
- **698 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-documentserver-datashaping/sortinginstruction/constructor/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-documentserver-datashaping/sortinginstruction/constructor/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-documentserver-datashaping/sortinginstruction/constructor/llms-full.txt

---

### Description

Initializes a new instance of the SortingInstruction class.

### Syntax

#### SortingInstruction(string, SortOrder)

Sets the column name to order the data by and sets the sort order (ascending / descending).

```csharp
public SortingInstruction(string orderBy, SortOrder sortOrder);
```

```vbnet
Public Sub New(orderBy As String, sortOrder As SortOrder)
```

| Parameter | Description |
|---|---|
| orderBy | The name of the column to order the block data by. |
| sortOrder | The sort order.  \| Value \| Meaning \| \| Ascending \| Data rows are sorted in an ascending order. \| \| Descending \| Data rows are sorted in a descending order. \| |
|---|

#### SortingInstruction(string)

Sets the column name to order the data by and sets the sort order to `SortOrder.Ascending`.

```csharp
public SortingInstruction(string orderBy);
```

```vbnet
Public Sub New(orderBy As String)
```

| Parameter | Description |
|---|---|
| orderBy | The name of the column to order the block data by. |

### Examples

The following example creates a Sorting Instruction instance and configures its order by setting for a document workflow.

```csharp
TXTextControl.DocumentServer.DataShaping.SortingInstruction sortingInstruction = new("Quarterly report");
sortingInstruction.OrderBy = "Quarterly report";
```

```vbnet
Dim sortingInstruction As New TXTextControl.DocumentServer.DataShaping.SortingInstruction("Quarterly report")
sortingInstruction.OrderBy = "Quarterly report"
```

---

## Nearby

- **Previous:** [SortingInstruction Class](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-documentserver-datashaping/sortinginstruction/llms-full.txt)
- **Next:** [SortingInstruction.Culture Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-documentserver-datashaping/sortinginstruction/culture-property/llms-full.txt)
