Skip to content

DevExpress-Examples/wpf-dashboard-how-to-bind-to-sql-database-file

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dashboard for WPF - How to bind a dashboard to a Microsoft SQL Server database file

This example shows how to bind a dashboard to a Microsoft SQL Server database file (*.mdf).

The dashboard and the data source are created at runtime. The dashboard data source is an instance of the DashboardSqlDataSource object with a SelectQuery to retrieve data. The data source is added to the Dashboard.DataSources collection. The data source connection parameters are not specified at this time.

The dashboard is assigned to the DashboardControl.DashboardSource property in the Window_Loaded event handler.

Before loading data, the dashboard control fires the DashboardControl.ConfigureDataConnection event. A connection string for the NorthWind database file is assigned to the CustomStringConnectionParameters.ConnectionString property accessible with the e.ConnectionParameters property. Note that the property returns an object of the base class - you should cast it to the CustomStringConnectionParameters type.

Subsequently the data source is filled with data automatically, and the dashboard displays the data.

Files to Review:

Documentation