# DataSourceManager Class

> The DataSourceManager class is designed for handling all existing kinds of data sources which can be used together with the MailMerge class. Use this class to determine which data tables, column names and data relations a data source contains and to insert merge block templates into documents.

- **Product:** TX Text Control .NET Server
- **Section:** Reference
- **Kind:** Class
- **Introduced:** 24.0
- **Namespace:** `TXTextControl.DocumentServer.DataSources`
- **Package:** `TXTextControl.TextControl.Core.SDK` (assembly `TXDocumentServer.Core.dll`, from the private NuGet feed or Text Control Offline Packages)
- **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
- **Path:** TX Text Control .NET Server > Reference > TXTextControl.DocumentServer.DataSources > DataSourceManager Class
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-documentserver-datasources/datasourcemanager/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-documentserver-datasources/datasourcemanager/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-documentserver-datasources/datasourcemanager/llms-full.txt

---

## On This Page

- [Description](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-documentserver-datasources/datasourcemanager/#description)
- [Syntax](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-documentserver-datasources/datasourcemanager/#syntax)
- [Examples](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-documentserver-datasources/datasourcemanager/#examples)
- [Members](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-documentserver-datasources/datasourcemanager/#members)

---

## In This Section

- [DataSourceManager.ConnectionString Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-documentserver-datasources/datasourcemanager/connectionstring-property/llms.txt): Gets the connection string of the connection selected with the DatabaseConnectionDialog. If no data connection was selected, this property returns an empty string.
- [DataSourceManager.ConnectionStringChanged Event](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-documentserver-datasources/datasourcemanager/connectionstringchanged-event/llms.txt): Is fired when the contents of the ConnectionString property change.
- [DataSourceManager Constructor](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-documentserver-datasources/datasourcemanager/constructor/llms.txt): Initializes a new instance of the DataSourceManager class.
- [DataSourceManager.DataProviderName Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-documentserver-datasources/datasourcemanager/dataprovidername-property/llms.txt): Gets the name of the data provider selected with the DatabaseConnectionDialog. If no data connection was selected, this property returns an empty string.
- [DataSourceManager.DataProviderNameChanged Event](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-documentserver-datasources/datasourcemanager/dataprovidernamechanged-event/llms.txt): Is fired when the contents of the DataProviderName property change.
- [DataSourceManager.DataRelations Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-documentserver-datasources/datasourcemanager/datarelations-property/llms.txt): Gets a DataRelationInfoCollection of DataRelationInfo objects which represent the data relations in the data source.
- [DataSourceManager.DataRelationsChanged Event](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-documentserver-datasources/datasourcemanager/datarelationschanged-event/llms.txt): Is fired when the contents of the DataRelations property change.
- [DataSourceManager.DataRowMerged Event](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-documentserver-datasources/datasourcemanager/datarowmerged-event/llms.txt): Occurs when a data row has been merged successfully. The event handler receives an argument of type DataRowMergedEventArgs containing data related to this event.
- [DataSourceManager.DataSourceCulture Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-documentserver-datasources/datasourcemanager/datasourceculture-property/llms.txt): Specifies the culture with which numerical and date / time values coming from the data source are parsed. The default value for this property is the current thread culture.
- [DataSourceManager.DataTables Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-documentserver-datasources/datasourcemanager/datatables-property/llms.txt): Gets a DataTableInfoCollection of DataTableInfo objects which represent the data tables in the data source.
- [DataSourceManager.DataTablesChanged Event](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-documentserver-datasources/datasourcemanager/datatableschanged-event/llms.txt): Is fired when the contents of the DataTables property change.
- [DataSourceManager.FieldMerged Event](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-documentserver-datasources/datasourcemanager/fieldmerged-event/llms.txt): Occurs when a field has been merged. The event handler receives an argument of type FieldMergedEventArgs containing data related to this event. This event can be used to change the field text and to determine whether the field has been merged successfully.
- [DataSourceManager.InsertMergeBlock Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-documentserver-datasources/datasourcemanager/insertmergeblock-method/llms.txt): Inserts a repeating merge block into a TextControl instance, a WPF.TextControl instance or a ServerTextControl instance at the current input position.
- [DataSourceManager.IsMergeBlock Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-documentserver-datasources/datasourcemanager/ismergeblock-method/llms.txt): Checks if a given SubTextPart is a merge block.
- [DataSourceManager.IsMergingPossible Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-documentserver-datasources/datasourcemanager/ismergingpossible-property/llms.txt): Gets a value indicating whether all requirements are met and the method Merge can be called.
- [DataSourceManager.IsMergingPossibleChanged Event](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-documentserver-datasources/datasourcemanager/ismergingpossiblechanged-event/llms.txt): Is fired when the value of the IsMergingPossible property changes.
- [DataSourceManager.LoadAssembly Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-documentserver-datasources/datasourcemanager/loadassembly-method/llms.txt): Loads an assembly file as a data source. Automatically deduces table and column names as well as data relations from the public properties of all public classes found in the assembly.
- [DataSourceManager.LoadDataSet Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-documentserver-datasources/datasourcemanager/loaddataset-method/llms.txt): Loads a System.Data.DataSet object as a data source.
- [DataSourceManager.LoadDataSourceConfig Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-documentserver-datasources/datasourcemanager/loaddatasourceconfig-method/llms.txt): 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.
- [DataSourceManager.LoadDataTable Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-documentserver-datasources/datasourcemanager/loaddatatable-method/llms.txt): Loads a System.Data.DataTable object as a data source.
- [DataSourceManager.LoadJson Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-documentserver-datasources/datasourcemanager/loadjson-method/llms.txt): Loads a JSON string containing an array of objects or a single object as a data source. Automatically deduces table and column names as well as data relations from property names and nested objects in the given single object or, in case of an array, the first object.
- [DataSourceManager.LoadObjects Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-documentserver-datasources/datasourcemanager/loadobjects-method/llms.txt): Loads a collection implementing the interface IEnumerable as a data source and deduces the data tables, column names and data relations from the public properties and used classes of the first contained object using .NET reflection or, in case of the first contained object being a Dictionary with string keys, from the key names and value types.
- [DataSourceManager.LoadSingleObject Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-documentserver-datasources/datasourcemanager/loadsingleobject-method/llms.txt): Loads a single object which is either a Dictionary with string keys or an object of an arbitrary type as a data source. The data tables, column names are deduced either from the key names or the public property names and types using .NET reflection.
- [DataSourceManager.LoadXmlFile Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-documentserver-datasources/datasourcemanager/loadxmlfile-method/llms.txt): Loads the contents of an XML file as a data source.
- [DataSourceManager.LoadXmlString Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-documentserver-datasources/datasourcemanager/loadxmlstring-method/llms.txt): Loads XML data, given as a string, as a data source.
- [DataSourceManager.MasterDataTableInfo Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-documentserver-datasources/datasourcemanager/masterdatatableinfo-property/llms.txt): Gets or sets a DataTableInfo object representing the table which is used as a master table when merging data into the document. Changing the master table with this property influences the return values of the PossibleMergeBlockTables and the PossibleMergeFieldColumns properties.
- [DataSourceManager.MasterDataTableInfoChanged Event](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-documentserver-datasources/datasourcemanager/masterdatatableinfochanged-event/llms.txt): Is fired when the contents of the MasterDataTableInfo property change.
- [DataSourceManager.MaxMergeResults Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-documentserver-datasources/datasourcemanager/maxmergeresults-property/llms.txt): Specifies the Upper merge result count. The default value for this property is int.MaxValue.
- [DataSourceManager.Merge Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-documentserver-datasources/datasourcemanager/merge-method/llms.txt): Merges a binary TX internal unicode format document with the currently loaded data source.
- [DataSourceManager.MergeCulture Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-documentserver-datasources/datasourcemanager/mergeculture-property/llms.txt): Specifies the culture with which numerical and date / time values are formatted when merged into the target document. The default value for this property is the current thread culture.
- [DataSourceManager.PossibleMergeBlockTables Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-documentserver-datasources/datasourcemanager/possiblemergeblocktables-property/llms.txt): Gets a DataTableInfoCollection of DataTableInfo objects representing the tables which can be used as merge blocks using the currently selected master table.
- [DataSourceManager.PossibleMergeBlockTablesChanged Event](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-documentserver-datasources/datasourcemanager/possiblemergeblocktableschanged-event/llms.txt): Is fired when the contents of the PossibleMergeBlockTables property change.
- [DataSourceManager.PossibleMergeFieldColumns Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-documentserver-datasources/datasourcemanager/possiblemergefieldcolumns-property/llms.txt): Gets a DataColumnInfoCollection of DataColumnInfo objects representing the table columns which can be used as merge fields using the currently selected master table.
- [DataSourceManager.PossibleMergeFieldColumnsChanged Event](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-documentserver-datasources/datasourcemanager/possiblemergefieldcolumnschanged-event/llms.txt): Is fired when the contents of the PossibleMergeFieldColumns property change.
- [DataSourceManager.SaveDataSourceConfig Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-documentserver-datasources/datasourcemanager/savedatasourceconfig-method/llms.txt): 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.

---

## Nearby

- **Previous:** [DataRelationInfoCollection.Item Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-documentserver-datasources/datarelationinfocollection/item-property/llms.txt)
- **Next:** [DataSourceManager.ConnectionString Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-documentserver-datasources/datasourcemanager/connectionstring-property/llms.txt)
