This example fetches data from the Azure SQL Database and displays it in the GridControl.
Note
To bind any dataset to a data-aware control, the dataset must implement the
IList
orIListSource
interface. Read the following help topic for additional information: Data Binding.
This example contains sample AdventureWorksLT data. To generate a sample database identical to the one used in this example, follow the Quickstart: Create a single database in Azure SQL Database using the Azure portal, PowerShell, and Azure CLI Microsoft article.
Ribbon UI commands allow you to bind to a sample Azure database using one of the following methods:
- Direct binding to a standard DataTable object
- Binding with a DevExpress SqlDataSource component
- Binding with an Entity Framework model
Do the following to run this example:
-
Specify connection settings in the
Main
method:static class Program { /// <summary> /// The main entry point for the application. /// </summary> [STAThread] static void Main() { ConnectionSettings.SetUp("your_server_name.database.windows.net", "your_login", "your_password", "your_database_name"); ConnectionSettings.SelectQuery = "SELECT * FROM SalesLT.Product"; EFDataProvider.PreInitContext(); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Main()); } }
(you will be redirected to DevExpress.com to submit your response)