I want to add datasource by code which I am able to do and it shows like below. But its not showing any tables or any stored proc from the database.
I am using below code to add datasource from code:
Code: Select all
public void LoadSubMenuDataSource(StiReport report)
{
if (report.Dictionary.Databases.Contains("MoosaDatabase")) return;
var sqlDatabase = new StiSqlDatabase("MoosaDatabase", _connectionString);
report.Dictionary.Databases.Add(sqlDatabase);
var dataSource = new StiSqlSource(
"MoosaDatabase",
"SubMenuDataSource",
"SubMenu",
"SELECT * FROM SubMenu"
);
report.Dictionary.DataSources.Add(dataSource);
}