# DataSourceManager.LoadDataSourceConfig Method

> Loads an XML string or a file containing "report data source configuration" data. Data Source Configuration Files can only be used in Windows Forms applications. When calling this method from a WPF Application, an exception is thrown. For more information about data source configuration files see method SaveDataSourceConfig.

- **Product:** TX Text Control .NET Server
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 24.0
- **Namespace:** `TXTextControl.DocumentServer.DataSources`
- **Package:** `TXTextControl.TextControl.ASP.SDK` (assembly `TXDocumentServer.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXDocumentServer.dll` from the setup
- **Not in:** `TXTextControl.TextControl.Core.SDK`
- **Path:** TX Text Control .NET Server > Reference > TXTextControl.DocumentServer.DataSources > DataSourceManager.LoadDataSourceConfig Method
- **747 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-documentserver-datasources/datasourcemanager/loaddatasourceconfig-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-documentserver-datasources/datasourcemanager/loaddatasourceconfig-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-documentserver-datasources/datasourcemanager/loaddatasourceconfig-method/llms-full.txt

---

### Description

Loads an XML string or a file containing "report data source configuration" data. Data Source Configuration Files can only be used in Windows Forms applications. When calling this method from a WPF Application, an exception is thrown. For more information about data source configuration files see method [SaveDataSourceConfig](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-documentserver-datasources/datasourcemanager/savedatasourceconfig-method/llms-full.txt).

### Syntax

#### LoadDataSourceConfig()

Shows the system's default open file dialog where a configuration file can be selected.

```csharp
public void LoadDataSourceConfig();
```

```vbnet
Public Sub LoadDataSourceConfig()
```

#### LoadDataSourceConfig(object)

Shows the system's default open file dialog where a configuration file can be selected.

```csharp
public void LoadDataSourceConfig(object owner);
```

```vbnet
Public Sub LoadDataSourceConfig(owner As Object)
```

| Parameter | Description |
|---|---|
| owner | An object that represents the top-level window that will own the modal dialog box. |

#### LoadDataSourceConfig(string)

Loads XML configuration data given as a string.

```csharp
public void LoadDataSourceConfig(string configData);
```

```vbnet
Public Sub LoadDataSourceConfig(configData As String)
```

| Parameter | Description |
|---|---|
| configData | A string containing XML configuration data. |

### Examples

The following example uses Load Data Source Config in a focused Data Source Manager workflow. The created object is then available to the surrounding document workflow.

```csharp
dataSourceManager.LoadDataSourceConfig("Approved");
Console.WriteLine("Data Source Manager is ready for use.");
```

```vbnet
dataSourceManager.LoadDataSourceConfig("Approved")
Console.WriteLine("Data Source Manager is ready for use.")
```

---

## Nearby

- **Previous:** [DataSourceManager.LoadDataSet Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-documentserver-datasources/datasourcemanager/loaddataset-method/llms-full.txt)
- **Next:** [DataSourceManager.LoadDataTable Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-documentserver-datasources/datasourcemanager/loaddatatable-method/llms-full.txt)
