Exago .NET API Documentation
DataSources Property (Api)
Example 
WebReports.Api Namespace > Api Class : DataSources Property
A collection of Data Sources in the current configuration. Data Sources are DataSource objects, and are managed via a DataSourceCollection object accessible through this property.
Syntax
public DataSourceCollection DataSources {get;}
Example
Set the Connection String of an Existing Data Source
// set data connection string for a specific datasource
DataSource dataSource = api.DataSources.GetDataSource("MyDb");
dataSource.DataConnStr = "Server=SVR;Database=db1;uid=userId;pwd=password;";
Connect to a New Microsoft SQL Server Data Source
//instantiate the new Data Source object
DataSource myNewDataSource = new DataSource();
myNewDataSource.Name = "Donations";
myNewDataSource.DbType = Constants.DatabaseType.SqlServer;
myNewDataSource.Schema = "dbo";
myNewDataSource.DataConnStr = "Server=databaseServer;Database=databaseName;Uid=dbuserid;Pwd=dbpassword;";

//add the new object to the DataSources collection
api.DataSources.Add(myNewDataSource);
Connect to a New Microsoft Excel File as a Data Source
//instantiate the new Data Source object
DataSource anExcelFile = new DataSource();
anExcelFile.Name = "Spinitron";
anExcelFile.DbType = Constants.DatabaseType.File;
anExcelFile.DataConnStr = "File=D:\\spinitron.xlsx; Type=Excel";
		
//add the new object to the DataSources collection
api.DataSources.Add(anExcelFile);
Retrieve the connection string of an existing data souce
api.DataSources.GetDataSource("dataSourceName").DataConnStr;
See Also

Reference

Api Class
Api Members