Skip to content

Commit f810ea4

Browse files
993738: Updated the UG content and samples for Connecting to DataBase Section in Blazor DataGrid
1 parent ed39f45 commit f810ea4

File tree

3 files changed

+22
-24
lines changed

3 files changed

+22
-24
lines changed

blazor/datagrid/connecting-to-database/dapper.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ documentation: ug
99

1010
# Connecting SQL data to a Blazor DataGrid Component using Dapper
1111

12-
The Syncfusion<sup style="font-size:70%">&reg;</sup> Blazor DataGrid component supports binding data from Microsoft SQL Server using [Dapper](https://github.com/DapperLib/Dapper) and [System.Data.SqlClient](https://www.nuget.org/packages/System.Data.SqlClient/4.8.6?_src=template). **Dapper** is a lightweight object-relational mapper (ORM) that simplifies executing SQL queries and mapping results to C# domain models.
12+
The Syncfusion<sup style="font-size:70%">&reg;</sup> Blazor DataGrid component supports binding data from Microsoft SQL Server using [Dapper](https://github.com/DapperLib/Dapper) and [System.Data.SqlClient](https://www.nuget.org/packages/System.Data.SqlClient/4.8.6?_src=template).**Dapper** is a lightweight object-relational mapper (ORM) that simplifies executing SQL queries and mapping results to C# domain models.
1313

1414
Data from SQL Server can be integrated into the Blazor DataGrid using multiple approaches:
1515

@@ -19,11 +19,11 @@ Data from SQL Server can be integrated into the Blazor DataGrid using multiple a
1919

2020
This guide demonstrates two approaches for integrating SQL Server data with the Blazor DataGrid using **Dapper**:
2121

22-
* **Remote binding via API service using UrlAdaptor**
22+
**Using UrlAdaptor**
2323

2424
This approach connects the DataGrid to a REST API endpoint that returns data in the required format. The [UrlAdaptor](https://blazor.syncfusion.com/documentation/datagrid/connecting-to-adaptors/url-adaptor) handles communication between the component and the API, enabling server-side operations such as **paging**, **sorting**, and **filtering**.
2525

26-
* **Custom binding using CustomAdaptor**
26+
**Using CustomAdaptor**
2727

2828
This approach provides complete control over data operations by implementing a [CustomAdaptor](https://blazor.syncfusion.com/documentation/datagrid/connecting-to-adaptors/custom-adaptor) class. It allows overriding methods for reading, updating, inserting, and deleting data, making it suitable for scenarios requiring custom business logic or complex queries.
2929

@@ -207,7 +207,7 @@ Access the theme stylesheet and script from NuGet using [Static Web Assets](http
207207
208208
5. **Configure DataGrid with UrlAdaptor**
209209

210-
The [SfDataManager](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Data.SfDataManager.html) component supports multiple adaptors for remote data binding. For API services, set the [Adaptor](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Adaptors.html) property to [Adaptors.UrlAdaptor](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Adaptors.html#Syncfusion_Blazor_Adaptors_UrlAdaptor) and specify the service endpoint in the [Url](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.DataManager.html#Syncfusion_Blazor_DataManager_Url) property.
210+
The [DataManager](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Data.SfDataManager.html) component supports multiple adaptors for remote data binding. For API services, set the [Adaptor](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Adaptors.html) property to [Adaptors.UrlAdaptor](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Adaptors.html#Syncfusion_Blazor_Adaptors_UrlAdaptor) and specify the service endpoint in the [Url](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.DataManager.html#Syncfusion_Blazor_DataManager_Url) property.
211211

212212
{% tabs %}
213213
{% highlight razor tabtitle="Index.razor"%}

blazor/datagrid/connecting-to-database/microsoft-sql-server.md

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ The Syncfusion<sup style="font-size:70%">&reg;</sup> Blazor DataGrid component s
1717

1818
This guide explains two primary approaches for integrating Microsoft SQL Server data with the Blazor DataGrid:
1919

20-
* **Remote Data Binding using UrlAdaptor**: Enables communication between the DataGrid and a remote API service connected to SQL Server. This approach is suitable when the API implements custom logic for data operations and returns results in the **result** and **count** format.
20+
**Using UrlAdaptor**: Enables communication between the DataGrid and a remote API service connected to SQL Server. This approach is suitable when the API implements custom logic for data operations and returns results in the **result** and **count** format.
2121

2222
{% youtube "youtube:https://www.youtube.com/watch?v=Y3grzt0ZdLk" %}
2323

24-
* **Custom Data Binding using CustomAdaptor**: Provides full control over data operations and CRUD functionality. It allows implementing custom logic for **searching**, **filtering**, **sorting**, **paging**, and **grouping** directly in server-side code.
24+
**Using CustomAdaptor**: Provides full control over data operations and CRUD functionality. It allows implementing custom logic for **searching**, **filtering**, **sorting**, **paging**, and **grouping** directly in server-side code.
2525

2626
{% youtube "youtube:https://www.youtube.com/watch?v=8yLpSCJLcXI" %}
2727

@@ -33,12 +33,12 @@ Microsoft SQL Server is a relational database management system (**RDBMS**) deve
3333

3434
**Key Features**
3535

36-
**Relational Database Model**: Organizes data into tables with rows and columns.
37-
**T-SQL Support**: Provides **Transact-SQL** for advanced querying and procedural programming.
38-
**High Availability**: Features like Always On Availability Groups for failover and disaster recovery.
39-
**Security**: Includes **encryption**, **authentication**, and **role-based access** control.
40-
**Integration**: Works with .NET applications, Azure services, and supports REST APIs.
41-
**Scalability**: Handles large datasets and supports both on-premises and cloud deployments.
36+
- **Relational Database Model**: Organizes data into tables with rows and columns.
37+
- **T-SQL Support**: Provides **Transact-SQL** for advanced querying and procedural programming.
38+
- **High Availability**: Features like Always On Availability Groups for failover and disaster recovery.
39+
- **Security**: Includes **encryption**, **authentication**, and **role-based access** control.
40+
- **Integration**: Works with .NET applications, Azure services, and supports REST APIs.
41+
- **Scalability**: Handles large datasets and supports both on-premises and cloud deployments.
4242

4343
For more details, refer to the official [Microsoft documentation](https://learn.microsoft.com/en-us/sql/sql-server/what-is-sql-server?view=sql-server-ver17).
4444

@@ -216,7 +216,7 @@ N>
216216

217217
**Step 5: Configure DataGrid with UrlAdaptor**
218218

219-
Use [SfDataManager](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Data.SfDataManager.html) to connect the DataGrid to the API endpoint and set the [Adaptor](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Adaptors.html) property to [Adaptors.UrlAdaptor](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Adaptors.html#Syncfusion_Blazor_Adaptors_UrlAdaptor).
219+
Use [DataManager](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Data.SfDataManager.html) to connect the DataGrid to the API endpoint and set the [Adaptor](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Adaptors.html) property to [Adaptors.UrlAdaptor](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Adaptors.html#Syncfusion_Blazor_Adaptors_UrlAdaptor).
220220

221221
{% tabs %}
222222
{% highlight razor tabtitle="Index.razor" %}
@@ -492,20 +492,18 @@ public object Post([FromBody] DataManagerRequest DataManagerRequest)
492492

493493
**Key Points**
494494

495-
* `request.Skip` specifies the number of records to skip.
496-
* `request.Take` specifies the number of records to retrieve.
497-
* `PerformSkip` and `PerformTake` enable efficient server-side paging.
495+
* **request.Skip** specifies the number of records to skip.
496+
* **request.Take** specifies the number of records to retrieve.
497+
* **PerformSkip** and **PerformTake** enable efficient server-side paging.
498498
* Custom paging logic can be added before or after applying these methods.
499499

500500
> **Best Practice**:
501-
502501
For optimal performance, apply operations in the following sequence on the server side:
503-
504502
**Searching → Filtering → Sorting → Aggregation → Paging**
505503

506504
### Handling CRUD operations Using UrlAdaptor
507505

508-
The Syncfusion<sup style="font-size:70%">&reg;</sup> Blazor DataGrid supports **Create**, **Read**, **Update**, and **Delete** (**CRUD**) operations through the [SfDataManager](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Data.SfDataManager.html) component. API endpoints for these operations are mapped using properties such as:
506+
The Syncfusion<sup style="font-size:70%">&reg;</sup> Blazor DataGrid supports **Create**, **Read**, **Update**, and **Delete** (**CRUD**) operations through the [DataManager](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Data.SfDataManager.html) component. API endpoints for these operations are mapped using properties such as:
509507

510508
* [InsertUrl](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.DataManager.html#Syncfusion_Blazor_DataManager_InsertUrl) – API endpoint for inserting new records.
511509
* [UpdateUrl](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.DataManager.html#Syncfusion_Blazor_DataManager_UpdateUrl) – API endpoint for updating existing records.
@@ -628,7 +626,7 @@ public void Delete([FromBody] CRUDModel<Order> Value)
628626

629627
**Batch Operation:**
630628

631-
To perform batch updates, set the edit [Mode](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.GridEditSettings.html#Syncfusion_Blazor_Grids_GridEditSettings_Mode) to **Batch** in the [GridEditSettings](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.GridEditSettings.html) component and configure the [BatchUrl](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.DataManager.html#Syncfusion_Blazor_DataManager_BatchUrl) property in the [SfDataManager](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Data.SfDataManager.html).
629+
To perform batch updates, set the edit [Mode](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.GridEditSettings.html#Syncfusion_Blazor_Grids_GridEditSettings_Mode) to **Batch** in the [GridEditSettings](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.GridEditSettings.html) component and configure the [BatchUrl](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.DataManager.html#Syncfusion_Blazor_DataManager_BatchUrl) property in the [DataManager](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Data.SfDataManager.html).
632630
In batch mode:
633631

634632
- Use the **Add** toolbar button to insert new rows.

blazor/datagrid/connecting-to-database/mysql-server.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ The Syncfusion<sup style="font-size:70%">&reg;</sup> Blazor DataGrid component s
1515
- Implementing a [CustomAdaptor](https://blazor.syncfusion.com/documentation/datagrid/connecting-to-adaptors/custom-adaptor) for custom logic.
1616
- Configuring remote data binding through adaptors such as [UrlAdaptor](https://blazor.syncfusion.com/documentation/data/adaptors#url-adaptor).
1717

18-
* **Remote Data Binding using UrlAdaptor**
18+
**Using UrlAdaptor**
1919

2020
The [UrlAdaptor](https://blazor.syncfusion.com/documentation/data/adaptors#url-adaptor) enables communication between the DataGrid and a remote API service connected to **MySQL** Server. This approach is suitable when the API implements custom logic for data operations and returns results in the **result** and **count** format.
2121

22-
* **Custom Data Binding using CustomAdaptor**
22+
**Using CustomAdaptor**
2323

2424
The [CustomAdaptor](https://blazor.syncfusion.com/documentation/datagrid/connecting-to-adaptors/custom-adaptor) provides full control over data operations and CRUD functionality. It allows implementing custom logic for **searching**, **filtering**, **sorting**, **paging**, and **grouping** directly in the server-side code.
2525

@@ -467,7 +467,7 @@ public void Insert([FromBody] CRUDModel<Order> Value)
467467

468468
**Update Operation:**
469469

470-
To edit a row, first select desired row and click the **Edit** toolbar button. The edit form will be displayed and proceed to modify any column value as per your requirement. Clicking the **Update** toolbar button will update the edit record in the Orders table by involving the following **Post** method of an API.
470+
To edit a row, select the required row and click the **Edit** button in the toolbar. An edit form will appear, allowing changes to any column value. After making the changes, click the **Update** button in the toolbar to save the record in the Orders table. This action triggers the following **POST** method in the API.
471471

472472
{% tabs %}
473473
{% highlight c# tabtitle="OrdersController.cs" %}
@@ -529,7 +529,7 @@ public void Delete([FromBody] CRUDModel<Order> Value)
529529

530530
**Batch Operation:**
531531

532-
To perform batch updates, set the edit [Mode](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.GridEditSettings.html#Syncfusion_Blazor_Grids_GridEditSettings_Mode) to **Batch** in the [GridEditSettings](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.GridEditSettings.html) component and configure the [BatchUrl](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.DataManager.html#Syncfusion_Blazor_DataManager_BatchUrl) property in the [SfDataManager](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Data.SfDataManager.html).
532+
To perform batch updates, set the edit [Mode](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.GridEditSettings.html#Syncfusion_Blazor_Grids_GridEditSettings_Mode) to **Batch** in the [GridEditSettings](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.GridEditSettings.html) component and configure the [BatchUrl](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.DataManager.html#Syncfusion_Blazor_DataManager_BatchUrl) property in the [DataManager](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Data.SfDataManager.html).
533533
In batch mode:
534534

535535
- Use the **Add** toolbar button to insert new rows.

0 commit comments

Comments
 (0)