TX Text Control .NET Server

SaveDataSourceConfig Method

Method|Introduced in 24.0
Namespace
TXTextControl.DocumentServer.DataSources
Package
TXTextControl.TextControl.ASP.SDK as TXDocumentServer.dll from the private NuGet feed or Text Control Offline Packages
Not in
TXTextControl.TextControl.Core.SDK

Description

Saves an XML string or a file containing "report data source config" data. Can only be called when a data provider based data source was loaded via the DatabaseConnectionDialog. The XML string contains information about the data provider, the connection string, the selected master table and existing data relations. Data Source Configuration Files can only be used in Windows Forms applications. When calling this method from a WPF Application, an exception is thrown.

Syntax

SaveDataSourceConfig()

Shows the system's default save file dialog where a file name and location can be selected.

public void SaveDataSourceConfig();

SaveDataSourceConfig(object)

Shows the system's default save file dialog where a file name and location can be selected.

public void SaveDataSourceConfig(object owner);
ParameterDescription
owner

An object that represents the top-level window that will own the modal dialog box.

SaveDataSourceConfig(out string)

Saves the configuration data into a given string.

public void SaveDataSourceConfig(out string configData);
ParameterDescription
configData

A string into which the config file content will be written when the method is called.

Examples

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

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