How to: Bind a Dashboard to an Entity Framework Data Source
- 3 minutes to read
To learn how to bind a dashboard to the Entity Framework data source using the Dashboard Designer, see Binding to EF Data Sources.
The following example demonstrates how to bind a dashboard to the SQLite database using Entity Framework 6.
In this example, the DashboardEFDataSource class is used to connect the dashboard to the Entity Framework data source.
Note
A complete sample project is available at https://github.com/DevExpress-Examples/how-to-bind-a-dashboard-to-an-entity-framework-data-source-at-runtime-t213415.
Imports System.Data.Entity
Imports System
Namespace Dashboard_EntityFramework
Partial Public Class OrdersContext
Inherits DbContext
Public Sub New()
MyBase.New("name=OrdersContext")
End Sub
Public Overridable Property Orders() As DbSet(Of Order)
End Class
Partial Public Class Order
Public Property OrderID() As Long
Public Property CustomerID() As String
Public Property EmployeeID() As Long?
Public Property OrderDate() As Date?
Public Property RequiredDate() As Date?
Public Property ShippedDate() As Date?
Public Property ShipVia() As Long?
Public Property Freight() As Decimal?
Public Property ShipName() As String
Public Property ShipAddress() As String
Public Property ShipCity() As String
Public Property ShipRegion() As String
Public Property ShipPostalCode() As String
Public Property ShipCountry() As String
End Class
End Namespace
See Also