# TextControl.LoadXMLDatabaseAsync Method

> Loads an XML database which is used to create table and field name menu items in the mailings ribbon tab. The method returns immediately and does not wait for the database to be completely loaded.

- **Product:** TX Text Control .NET Server
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 21.0
- **Namespace:** `TXTextControl.Web`
- **Assembly:** `TXTextControl.Web.dll`, which the TX Text Control .NET Server setup installs, for .NET Framework; in no NuGet package
- **Path:** TX Text Control .NET Server > Reference > TXTextControl.Web > TextControl.LoadXMLDatabaseAsync Method
- **905 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-web/textcontrol/loadxmldatabaseasync-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-web/textcontrol/loadxmldatabaseasync-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-web/textcontrol/loadxmldatabaseasync-method/llms-full.txt

---

### Description

Loads an XML database which is used to create table and field name menu items in the mailings ribbon tab. The method returns immediately and does not wait for the database to be completely loaded.

### Syntax

#### LoadXMLDatabaseAsync(String)

Loads an XML database from a file.

```csharp
public async System.Threading.Tasks.Task LoadXMLDatabaseAsync(string fileName);
```

```vbnet
Public Async Function LoadXMLDatabaseAsync(ByVal fileName as String) As System.Threading.Tasks.Task
```

| Parameter | Description |
|---|---|
| fileName | Specifies an xml file from which the database is loaded. |

#### LoadXMLDatabaseAsync(System.Xml.XmlDocument)

Loads an XML database from an XmlDocument object.

```csharp
public async System.Threading.Tasks.Task LoadXMLDatabaseAsync(System.Xml.XmlDocument xmlDocument);
```

```vbnet
Public Async Function LoadXMLDatabaseAsync(ByVal xmlDocument as System.Xml.XmlDocument) As System.Threading.Tasks.Task
```

| Parameter | Description |
|---|---|
| xmlDocument | Specifies an XmlDocument object from which the database is loaded. |

#### LoadXMLDatabaseAsync(System.IO.FileStream)

Loads an XML database from a file stream.

```csharp
public async System.Threading.Tasks.Task LoadXMLDatabaseAsync(System.IO.FileStream fileStream);
```

```vbnet
Public Async Function LoadXMLDatabaseAsync(ByVal fileStream as System.IO.FileStream) As System.Threading.Tasks.Task
```

| Parameter | Description |
|---|---|
| fileStream | Specifies an xml file from which the database is loaded. The data is loaded from the stream's current position. |

### Examples

The following example uses `TextControl.LoadXMLDatabase` in a document-processing workflow.

```csharp
var result = textControl.LoadXMLDatabase(@"App_Data\document.docx");
Console.WriteLine(result);
```

```vbnet
Dim result = textControl.LoadXMLDatabase("App_Data\document.docx")
Console.WriteLine(result)
```

---

## Nearby

- **Previous:** [TextControl.LoadXMLDatabase Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-web/textcontrol/loadxmldatabase-method/llms-full.txt)
- **Next:** [TextControl.ResetContents Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-web/textcontrol/resetcontents-method/llms-full.txt)
