You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Mapping query results to strongly typed C# models without manual data transformation.
46
46
* Reducing boilerplate code compared to traditional ADO.NET approaches.
47
47
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.
49
49
50
50
## Binding data using Dapper from Microsoft SQL Server via an API service.
51
51
@@ -85,10 +85,10 @@ Create a controller named **GridController.cs** under the Controllers folder.
85
85
86
86
**Step 4: Implement Data Retrieval Logic**
87
87
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.
89
89
90
90
{% tabs %}
91
-
{% highlight razor tabtitle="GridController.cs"%}
91
+
{% highlight razor tabtitle="GridController.cs"%}
92
92
using Microsoft.AspNetCore.Mvc;
93
93
using Newtonsoft.Json;
94
94
using Syncfusion.Blazor.Data;
@@ -210,7 +210,7 @@ Access the theme stylesheet and script from NuGet using [Static Web Assets](http
210
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.
211
211
212
212
{% tabs %}
213
-
{% highlight razor tabtitle="Index.razor"%}
213
+
{% highlight razor tabtitle="Index.razor"%}
214
214
@using Syncfusion.Blazor.Grids
215
215
@using Syncfusion.Blazor.Data
216
216
@using Syncfusion.Blazor
@@ -272,7 +272,7 @@ The [DataManager](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Data.S
272
272
}
273
273
}
274
274
{% endhighlight %}
275
-
{% highlight c# tabtitle="GridController.cs"%}
275
+
{% highlight c# tabtitle="GridController.cs"%}
276
276
public class GridController : ControllerBase
277
277
{
278
278
/// <summary>
@@ -646,7 +646,7 @@ Follow the procedure described in [Connecting Blazor DataGrid to an API service]
646
646
647
647
> * Set the rendermode to **InteractiveServer** or **InteractiveAuto** based on application configuration.
648
648
649
-
**Step 2: Install MySql NuGet Package**
649
+
**Step 2: Install MySQL NuGet Package**
650
650
651
651
Add the following packages to the Blazor application:
652
652
@@ -716,7 +716,7 @@ Inject a custom service into the `CustomAdaptor` and configure the component as
716
716
SfGrid<Order> Grid { get; set; }
717
717
}
718
718
{% endhighlight %}
719
-
{% highlight razor tabtitle="Orderdata.cs"%}
719
+
{% highlight razor tabtitle="Orderdata.cs"%}
720
720
public class Order
721
721
{
722
722
public int? OrderID { get; set; }
@@ -1128,7 +1128,7 @@ Each method can be customized to execute SQL commands against the Microsoft SQL
1128
1128
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.
1129
1129
1130
1130
{% tabs %}
1131
-
{% highlight razor tabtitle="Index.razor"%}
1131
+
{% highlight razor tabtitle="Index.razor"%}
1132
1132
/// <summary>
1133
1133
/// Inserts a new data item into the data collection.
1134
1134
/// </summary>
@@ -1144,7 +1144,7 @@ public override async Task<object> InsertAsync(DataManager DataManager, object V
1144
1144
return Value;
1145
1145
}
1146
1146
{% endhighlight %}
1147
-
{% highlight razor tabtitle="Orderdata.cs"%}
1147
+
{% highlight razor tabtitle="Orderdata.cs"%}
1148
1148
public async Task AddOrderAsync(Order Value)
1149
1149
{
1150
1150
//Create query to insert the specific into the database by accessing its properties
@@ -1164,7 +1164,7 @@ public async Task AddOrderAsync(Order Value)
1164
1164
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.
1165
1165
1166
1166
{% tabs %}
1167
-
{% highlight razor tabtitle="Index.razor"%}
1167
+
{% highlight razor tabtitle="Index.razor"%}
1168
1168
/// <summary>
1169
1169
/// Updates an existing data item in the data collection.
1170
1170
/// </summary>
@@ -1181,7 +1181,7 @@ public override async Task<object> UpdateAsync(DataManager DataManager, object V
1181
1181
return Value;
1182
1182
}
1183
1183
{% endhighlight %}
1184
-
{% highlight razor tabtitle="Orderdata.cs"%}
1184
+
{% highlight razor tabtitle="Orderdata.cs"%}
1185
1185
public async Task UpdateOrderAsync(Order Value)
1186
1186
{
1187
1187
//Create query to update the changes into the database by accessing its properties
@@ -1201,7 +1201,7 @@ public async Task UpdateOrderAsync(Order Value)
1201
1201
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.
1202
1202
1203
1203
{% tabs %}
1204
-
{% highlight razor tabtitle="Index.razor"%}
1204
+
{% highlight razor tabtitle="Index.razor"%}
1205
1205
/// <summary>
1206
1206
/// Removes a data item from the data collection.
1207
1207
/// </summary>
@@ -1218,7 +1218,7 @@ public override async Task<object> RemoveAsync(DataManager DataManager, object V
1218
1218
return Value;
1219
1219
}
1220
1220
{% endhighlight %}
1221
-
{% highlight razor tabtitle="Orderdata.cs"%}
1221
+
{% highlight razor tabtitle="Orderdata.cs"%}
1222
1222
public async Task RemoveOrderAsync(int? Key)
1223
1223
{
1224
1224
//Create query to remove the specific from database by passing the primary key column value.
Copy file name to clipboardExpand all lines: blazor/datagrid/connecting-to-database/microsoft-sql-server.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -530,7 +530,7 @@ To enable [editing](https://blazor.syncfusion.com/documentation/datagrid/editing
530
530
{% endtabs %}
531
531
532
532
> * 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.
Copy file name to clipboardExpand all lines: blazor/datagrid/connecting-to-database/mysql-server.md
+10-10Lines changed: 10 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -184,7 +184,7 @@ Access the theme stylesheet and script from NuGet using [Static Web Assets](http
184
184
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.
185
185
186
186
{% tabs %}
187
-
{% highlight razor tabtitle="Index.razor"%}
187
+
{% highlight razor tabtitle="Index.razor"%}
188
188
@using Syncfusion.Blazor.Grids
189
189
@using Syncfusion.Blazor.Data
190
190
@using Syncfusion.Blazor
@@ -244,7 +244,7 @@ The [SfDataManager](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Data
244
244
}
245
245
}
246
246
{% endhighlight %}
247
-
{% highlight c# tabtitle="GridController.cs"%}
247
+
{% highlight c# tabtitle="GridController.cs"%}
248
248
[ApiController]
249
249
public class GridController : ControllerBase
250
250
{
@@ -615,7 +615,7 @@ Follow the procedure described in [Connecting Blazor DataGrid to an API service]
615
615
616
616
> * Set the rendermode to **InteractiveServer** or **InteractiveAuto** based on application configuration.
617
617
618
-
**Step 2: Install MySql NuGet Package**
618
+
**Step 2: Install MySQL NuGet Package**
619
619
620
620
Install the **MySql.Data** package to connect to MySQL Server.
621
621
@@ -680,7 +680,7 @@ Inject a custom service into the `CustomAdaptor` and configure the component as
680
680
SfGrid<Order> Grid { get; set; }
681
681
}
682
682
{% endhighlight %}
683
-
{% highlight razor tabtitle="Orderdata.cs"%}
683
+
{% highlight razor tabtitle="Orderdata.cs"%}
684
684
public class Order
685
685
{
686
686
public int? OrderID { get; set; }
@@ -1089,7 +1089,7 @@ Each method can be customized to execute SQL commands against the **Microsoft SQ
1089
1089
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.
1090
1090
1091
1091
{% tabs %}
1092
-
{% highlight razor tabtitle="Index.razor"%}
1092
+
{% highlight razor tabtitle="Index.razor"%}
1093
1093
/// <summary>
1094
1094
/// Inserts a new data item into the data collection.
1095
1095
/// </summary>
@@ -1105,7 +1105,7 @@ public override async Task<object> InsertAsync(DataManager DataManager, object V
1105
1105
return Value;
1106
1106
}
1107
1107
{% endhighlight %}
1108
-
{% highlight razor tabtitle="Orderdata.cs"%}
1108
+
{% highlight razor tabtitle="Orderdata.cs"%}
1109
1109
public async Task AddOrderAsync(Order Value)
1110
1110
{
1111
1111
//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
1126
1126
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.
1127
1127
1128
1128
{% tabs %}
1129
-
{% highlight razor tabtitle="Index.razor"%}
1129
+
{% highlight razor tabtitle="Index.razor"%}
1130
1130
/// <summary>
1131
1131
/// Updates an existing data item in the data collection.
1132
1132
/// </summary>
@@ -1143,7 +1143,7 @@ public override async Task<object> UpdateAsync(DataManager DataManager, object V
1143
1143
return Value;
1144
1144
}
1145
1145
{% endhighlight %}
1146
-
{% highlight razor tabtitle="Orderdata.cs"%}
1146
+
{% highlight razor tabtitle="Orderdata.cs"%}
1147
1147
public async Task UpdateOrderAsync(Order Value)
1148
1148
{
1149
1149
//Create query to update the changes into the database by accessing its properties
@@ -1164,7 +1164,7 @@ public async Task UpdateOrderAsync(Order Value)
1164
1164
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.
1165
1165
1166
1166
{% tabs %}
1167
-
{% highlight razor tabtitle="Index.razor"%}
1167
+
{% highlight razor tabtitle="Index.razor"%}
1168
1168
/// <summary>
1169
1169
/// Removes a data item from the data collection.
1170
1170
/// </summary>
@@ -1181,7 +1181,7 @@ public override async Task<object> RemoveAsync(DataManager DataManager, object V
1181
1181
return Value;
1182
1182
}
1183
1183
{% endhighlight %}
1184
-
{% highlight razor tabtitle="Orderdata.cs"%}
1184
+
{% highlight razor tabtitle="Orderdata.cs"%}
1185
1185
public async Task RemoveOrderAsync(int? Key)
1186
1186
{
1187
1187
//Create query to remove the specific from database by passing the primary key column value.
0 commit comments