Skip to content

Commit 5219181

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

File tree

3 files changed

+24
-24
lines changed

3 files changed

+24
-24
lines changed

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

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Dapper simplifies database operations by:
4545
* Mapping query results to strongly typed C# models without manual data transformation.
4646
* Reducing boilerplate code compared to traditional ADO.NET approaches.
4747

48-
When combined with S**ystem.Data.SqlClient**, Dapper offers a streamlined way to interact with SQL Server in Blazor applications.
48+
When combined with **System.Data.SqlClient**, Dapper offers a streamlined way to interact with SQL Server in Blazor applications.
4949

5050
## Binding data using Dapper from Microsoft SQL Server via an API service.
5151

@@ -85,10 +85,10 @@ Create a controller named **GridController.cs** under the Controllers folder.
8585

8686
**Step 4: Implement Data Retrieval Logic**
8787

88-
In the controller, establish a connection to SQL Server using **SqlConnection** which implements IDbConnection interfface. Execute the query using **Dapper** and map the results to a strongly typed collection.
88+
In the controller, establish a connection to SQL Server using **SqlConnection** which implements IDbConnection interface. Execute the query using **Dapper** and map the results to a strongly typed collection.
8989

9090
{% tabs %}
91-
{% highlight razor tabtitle="GridController.cs"%}
91+
{% highlight razor tabtitle="GridController.cs" %}
9292
using Microsoft.AspNetCore.Mvc;
9393
using Newtonsoft.Json;
9494
using Syncfusion.Blazor.Data;
@@ -210,7 +210,7 @@ Access the theme stylesheet and script from NuGet using [Static Web Assets](http
210210
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 %}
213-
{% highlight razor tabtitle="Index.razor"%}
213+
{% highlight razor tabtitle="Index.razor" %}
214214
@using Syncfusion.Blazor.Grids
215215
@using Syncfusion.Blazor.Data
216216
@using Syncfusion.Blazor
@@ -272,7 +272,7 @@ The [DataManager](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Data.S
272272
}
273273
}
274274
{% endhighlight %}
275-
{% highlight c# tabtitle="GridController.cs"%}
275+
{% highlight c# tabtitle="GridController.cs" %}
276276
public class GridController : ControllerBase
277277
{
278278
/// <summary>
@@ -646,7 +646,7 @@ Follow the procedure described in [Connecting Blazor DataGrid to an API service]
646646

647647
> * Set the rendermode to **InteractiveServer** or **InteractiveAuto** based on application configuration.
648648
649-
**Step 2: Install MySql NuGet Package**
649+
**Step 2: Install MySQL NuGet Package**
650650

651651
Add the following packages to the Blazor application:
652652

@@ -716,7 +716,7 @@ Inject a custom service into the `CustomAdaptor` and configure the component as
716716
SfGrid<Order> Grid { get; set; }
717717
}
718718
{% endhighlight %}
719-
{% highlight razor tabtitle="Orderdata.cs"%}
719+
{% highlight razor tabtitle="Orderdata.cs" %}
720720
public class Order
721721
{
722722
public int? OrderID { get; set; }
@@ -1128,7 +1128,7 @@ Each method can be customized to execute SQL commands against the Microsoft SQL
11281128
To enable insertion in a Blazor DataGrid using a custom data binding approach, override the [Insert](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.DataAdaptor.html#Syncfusion_Blazor_DataAdaptor_Insert_Syncfusion_Blazor_DataManager_System_Object_System_String_) or [InsertAsync](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.DataAdaptor.html#Syncfusion_Blazor_DataAdaptor_InsertAsync_Syncfusion_Blazor_DataManager_System_Object_System_String_) method of the `CustomAdaptor` class. This method is invoked when a new record is added to the grid.
11291129

11301130
{% tabs %}
1131-
{% highlight razor tabtitle="Index.razor"%}
1131+
{% highlight razor tabtitle="Index.razor" %}
11321132
/// <summary>
11331133
/// Inserts a new data item into the data collection.
11341134
/// </summary>
@@ -1144,7 +1144,7 @@ public override async Task<object> InsertAsync(DataManager DataManager, object V
11441144
return Value;
11451145
}
11461146
{% endhighlight %}
1147-
{% highlight razor tabtitle="Orderdata.cs"%}
1147+
{% highlight razor tabtitle="Orderdata.cs" %}
11481148
public async Task AddOrderAsync(Order Value)
11491149
{
11501150
//Create query to insert the specific into the database by accessing its properties
@@ -1164,7 +1164,7 @@ public async Task AddOrderAsync(Order Value)
11641164
To enable record updates in a Blazor DataGrid using a custom data binding approach, override the [Update](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.DataAdaptor.html#Syncfusion_Blazor_DataAdaptor_Update_Syncfusion_Blazor_DataManager_System_Object_System_String_System_String_) or [UpdateAsync](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.DataAdaptor.html#Syncfusion_Blazor_DataAdaptor_UpdateAsync_Syncfusion_Blazor_DataManager_System_Object_System_String_System_String_) method of the `CustomAdaptor` class. This method is triggered when an existing record is modified in the grid.
11651165

11661166
{% tabs %}
1167-
{% highlight razor tabtitle="Index.razor"%}
1167+
{% highlight razor tabtitle="Index.razor" %}
11681168
/// <summary>
11691169
/// Updates an existing data item in the data collection.
11701170
/// </summary>
@@ -1181,7 +1181,7 @@ public override async Task<object> UpdateAsync(DataManager DataManager, object V
11811181
return Value;
11821182
}
11831183
{% endhighlight %}
1184-
{% highlight razor tabtitle="Orderdata.cs"%}
1184+
{% highlight razor tabtitle="Orderdata.cs" %}
11851185
public async Task UpdateOrderAsync(Order Value)
11861186
{
11871187
//Create query to update the changes into the database by accessing its properties
@@ -1201,7 +1201,7 @@ public async Task UpdateOrderAsync(Order Value)
12011201
To enable deletion in a Blazor DataGrid using a custom data binding approach, override the [Remove](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.DataAdaptor.html#Syncfusion_Blazor_DataAdaptor_Remove_Syncfusion_Blazor_DataManager_System_Object_System_String_System_String_) or [RemoveAsync](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.DataAdaptor.html#Syncfusion_Blazor_DataAdaptor_RemoveAsync_Syncfusion_Blazor_DataManager_System_Object_System_String_System_String_) method of the `CustomAdaptor` class. This method is invoked when a record is removed from the grid.
12021202

12031203
{% tabs %}
1204-
{% highlight razor tabtitle="Index.razor"%}
1204+
{% highlight razor tabtitle="Index.razor" %}
12051205
/// <summary>
12061206
/// Removes a data item from the data collection.
12071207
/// </summary>
@@ -1218,7 +1218,7 @@ public override async Task<object> RemoveAsync(DataManager DataManager, object V
12181218
return Value;
12191219
}
12201220
{% endhighlight %}
1221-
{% highlight razor tabtitle="Orderdata.cs"%}
1221+
{% highlight razor tabtitle="Orderdata.cs" %}
12221222
public async Task RemoveOrderAsync(int? Key)
12231223
{
12241224
//Create query to remove the specific from database by passing the primary key column value.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,7 @@ To enable [editing](https://blazor.syncfusion.com/documentation/datagrid/editing
530530
{% endtabs %}
531531

532532
> * Set [IsPrimaryKey](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.GridColumn.html#Syncfusion_Blazor_Grids_GridColumn_IsPrimaryKey) to **true** for a column that contains unique values.
533-
> * If the database includes an a**uto-generated column**, set [IsIdentity](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.GridColumn.html#Syncfusion_Blazor_Grids_GridColumn_IsIdentity) for that column to disable editing during **add** or **update** operations.
533+
> * If the database includes an **auto-generated column**, set [IsIdentity](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.GridColumn.html#Syncfusion_Blazor_Grids_GridColumn_IsIdentity) for that column to disable editing during **add** or **update** operations.
534534
535535
**Insert Operation:**
536536

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ Access the theme stylesheet and script from NuGet using [Static Web Assets](http
184184
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.
185185

186186
{% tabs %}
187-
{% highlight razor tabtitle="Index.razor"%}
187+
{% highlight razor tabtitle="Index.razor" %}
188188
@using Syncfusion.Blazor.Grids
189189
@using Syncfusion.Blazor.Data
190190
@using Syncfusion.Blazor
@@ -244,7 +244,7 @@ The [SfDataManager](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Data
244244
}
245245
}
246246
{% endhighlight %}
247-
{% highlight c# tabtitle="GridController.cs"%}
247+
{% highlight c# tabtitle="GridController.cs" %}
248248
[ApiController]
249249
public class GridController : ControllerBase
250250
{
@@ -615,7 +615,7 @@ Follow the procedure described in [Connecting Blazor DataGrid to an API service]
615615

616616
> * Set the rendermode to **InteractiveServer** or **InteractiveAuto** based on application configuration.
617617
618-
**Step 2: Install MySql NuGet Package**
618+
**Step 2: Install MySQL NuGet Package**
619619

620620
Install the **MySql.Data** package to connect to MySQL Server.
621621

@@ -680,7 +680,7 @@ Inject a custom service into the `CustomAdaptor` and configure the component as
680680
SfGrid<Order> Grid { get; set; }
681681
}
682682
{% endhighlight %}
683-
{% highlight razor tabtitle="Orderdata.cs"%}
683+
{% highlight razor tabtitle="Orderdata.cs" %}
684684
public class Order
685685
{
686686
public int? OrderID { get; set; }
@@ -1089,7 +1089,7 @@ Each method can be customized to execute SQL commands against the **Microsoft SQ
10891089
To implement record insertion, override the [Insert](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.DataAdaptor.html#Syncfusion_Blazor_DataAdaptor_Insert_Syncfusion_Blazor_DataManager_System_Object_System_String_) or [InsertAsync](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.DataAdaptor.html#Syncfusion_Blazor_DataAdaptor_InsertAsync_Syncfusion_Blazor_DataManager_System_Object_System_String_) method in the `CustomAdaptor` class.
10901090

10911091
{% tabs %}
1092-
{% highlight razor tabtitle="Index.razor"%}
1092+
{% highlight razor tabtitle="Index.razor" %}
10931093
/// <summary>
10941094
/// Inserts a new data item into the data collection.
10951095
/// </summary>
@@ -1105,7 +1105,7 @@ public override async Task<object> InsertAsync(DataManager DataManager, object V
11051105
return Value;
11061106
}
11071107
{% endhighlight %}
1108-
{% highlight razor tabtitle="Orderdata.cs"%}
1108+
{% highlight razor tabtitle="Orderdata.cs" %}
11091109
public async Task AddOrderAsync(Order Value)
11101110
{
11111111
//Create query to insert the specific into the database by accessing its properties
@@ -1126,7 +1126,7 @@ public override async Task<object> InsertAsync(DataManager DataManager, object V
11261126
To implement record updates, override the [Update](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.DataAdaptor.html#Syncfusion_Blazor_DataAdaptor_Update_Syncfusion_Blazor_DataManager_System_Object_System_String_System_String_) or [UpdateAsync](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.DataAdaptor.html#Syncfusion_Blazor_DataAdaptor_UpdateAsync_Syncfusion_Blazor_DataManager_System_Object_System_String_System_String_) method in the `CustomAdaptor` class.
11271127

11281128
{% tabs %}
1129-
{% highlight razor tabtitle="Index.razor"%}
1129+
{% highlight razor tabtitle="Index.razor" %}
11301130
/// <summary>
11311131
/// Updates an existing data item in the data collection.
11321132
/// </summary>
@@ -1143,7 +1143,7 @@ public override async Task<object> UpdateAsync(DataManager DataManager, object V
11431143
return Value;
11441144
}
11451145
{% endhighlight %}
1146-
{% highlight razor tabtitle="Orderdata.cs"%}
1146+
{% highlight razor tabtitle="Orderdata.cs" %}
11471147
public async Task UpdateOrderAsync(Order Value)
11481148
{
11491149
//Create query to update the changes into the database by accessing its properties
@@ -1164,7 +1164,7 @@ public async Task UpdateOrderAsync(Order Value)
11641164
To perform record deletion, override the [Remove](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.DataAdaptor.html#Syncfusion_Blazor_DataAdaptor_Remove_Syncfusion_Blazor_DataManager_System_Object_System_String_System_String_) or [RemoveAsync](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.DataAdaptor.html#Syncfusion_Blazor_DataAdaptor_RemoveAsync_Syncfusion_Blazor_DataManager_System_Object_System_String_System_String_) method in the `CustomAdaptor` class.
11651165

11661166
{% tabs %}
1167-
{% highlight razor tabtitle="Index.razor"%}
1167+
{% highlight razor tabtitle="Index.razor" %}
11681168
/// <summary>
11691169
/// Removes a data item from the data collection.
11701170
/// </summary>
@@ -1181,7 +1181,7 @@ public override async Task<object> RemoveAsync(DataManager DataManager, object V
11811181
return Value;
11821182
}
11831183
{% endhighlight %}
1184-
{% highlight razor tabtitle="Orderdata.cs"%}
1184+
{% highlight razor tabtitle="Orderdata.cs" %}
11851185
public async Task RemoveOrderAsync(int? Key)
11861186
{
11871187
//Create query to remove the specific from database by passing the primary key column value.

0 commit comments

Comments
 (0)