How to add custom MSSQL datasource to show all stored procedures from database
Posted: Thu May 15, 2025 12:39 pm
Hi.
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:
If I write query then it only shows that but I have 100's of tables and I can't write queries for each table. Is there a way to include all tables and/or stored procedures to the dictionary.
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);
}