Skip to content

Commit 3c11bd2

Browse files
993738: Updated the UG content and samples for Connecting to DataBase Section in Blazor DataGrid
1 parent 60abfb0 commit 3c11bd2

File tree

2 files changed

+21
-21
lines changed

2 files changed

+21
-21
lines changed

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

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ documentation: ug
1212
The Syncfusion<sup style="font-size:70%">&reg;</sup> Blazor DataGrid component supports binding data from a [PostgreSQL](https://www.nuget.org/packages/Npgsql.EntityFrameworkCore.PostgreSQL) Server database using multiple approaches. Common methods include:
1313

1414
- Using the [DataSource](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.SfGrid-1.html#Syncfusion_Blazor_Grids_SfGrid_1_DataSource) property for local binding.
15-
- Implementing a [CustomAdaptor](https://blazor.syncfusion.com/documentation/datagrid/custom-binding) for custom logic.
15+
- 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

1818
This section explains how to connect and retrieve data from a PostgreSQL Server database using [Npgsql EntityFrameworkCore PostgreSQL](https://www.nuget.org/packages/Npgsql.EntityFrameworkCore.PostgreSQL) and bind the data to a Blazor DataGrid component through the following methods:
@@ -50,7 +50,7 @@ Add a controller named **GridController.cs** under the **Controllers** folder. T
5050
Use **NpgsqlConnection**, **NpgsqlCommand**, and **NpgsqlDataAdapter** to execute queries and fetch data from **PostgreSQL**. Populate the data into a DataTable and convert it into a strongly typed collection.
5151

5252
{% tabs %}
53-
{% highlight razor tabtitle="GridController.cs"%}
53+
{% highlight razor tabtitle="GridController.cs" %}
5454
using Microsoft.AspNetCore.Mvc;
5555
using Npgsql;
5656
using System.Data;
@@ -186,7 +186,7 @@ Access the theme stylesheet and script from NuGet using [Static Web Assets](http
186186
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.
187187

188188
{% tabs %}
189-
{% highlight razor tabtitle="Index.razor"%}
189+
{% highlight razor tabtitle="Index.razor" %}
190190
@using Syncfusion.Blazor.Grids
191191
@using Syncfusion.Blazor.Data
192192
@using Syncfusion.Blazor
@@ -246,7 +246,7 @@ The [DataManager](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Data.S
246246
}
247247
}
248248
{% endhighlight %}
249-
{% highlight c# tabtitle="GridController.cs"%}
249+
{% highlight c# tabtitle="GridController.cs" %}
250250
[ApiController]
251251
public class GridController : ControllerBase
252252
{
@@ -683,7 +683,7 @@ Inject a custom service into the `CustomAdaptor` and configure the component as
683683
SfGrid<Order> Grid { get; set; }
684684
}
685685
{% endhighlight %}
686-
{% highlight razor tabtitle="Orderdata.cs"%}
686+
{% highlight razor tabtitle="Orderdata.cs" %}
687687
public class Order
688688
{
689689
public int? OrderID { get; set; }
@@ -1094,7 +1094,7 @@ Each method can be customized to execute SQL commands against the **PostgreSQL**
10941094
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.
10951095

10961096
{% tabs %}
1097-
{% highlight razor tabtitle="Index.razor"%}
1097+
{% highlight razor tabtitle="Index.razor" %}
10981098
/// <summary>
10991099
/// Inserts a new data item into the data collection.
11001100
/// </summary>
@@ -1110,7 +1110,7 @@ public override async Task<object> InsertAsync(DataManager DataManager, object V
11101110
return Value;
11111111
}
11121112
{% endhighlight %}
1113-
{% highlight razor tabtitle="Orderdata.cs"%}
1113+
{% highlight razor tabtitle="Orderdata.cs" %}
11141114
public async Task AddOrderAsync(Order Value)
11151115
{
11161116
// Create query to insert the specific into the database by accessing its properties
@@ -1131,7 +1131,7 @@ public async Task AddOrderAsync(Order Value)
11311131
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.
11321132

11331133
{% tabs %}
1134-
{% highlight razor tabtitle="Index.razor"%}
1134+
{% highlight razor tabtitle="Index.razor" %}
11351135
/// <summary>
11361136
/// Updates an existing data item in the data collection.
11371137
/// </summary>
@@ -1148,7 +1148,7 @@ public override async Task<object> UpdateAsync(DataManager DataManager, object V
11481148
return Value;
11491149
}
11501150
{% endhighlight %}
1151-
{% highlight razor tabtitle="Orderdata.cs"%}
1151+
{% highlight razor tabtitle="Orderdata.cs" %}
11521152
public async Task UpdateOrderAsync(Order Value)
11531153
{
11541154
//Create query to update the changes into the database by accessing its properties
@@ -1169,7 +1169,7 @@ public async Task UpdateOrderAsync(Order Value)
11691169
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.
11701170

11711171
{% tabs %}
1172-
{% highlight razor tabtitle="Index.razor"%}
1172+
{% highlight razor tabtitle="Index.razor" %}
11731173
/// <summary>
11741174
/// Removes a data item from the data collection.
11751175
/// </summary>
@@ -1186,7 +1186,7 @@ public override async Task<object> RemoveAsync(DataManager DataManager, object V
11861186
return Value;
11871187
}
11881188
{% endhighlight %}
1189-
{% highlight razor tabtitle="Orderdata.cs"%}
1189+
{% highlight razor tabtitle="Orderdata.cs" %}
11901190
public async Task RemoveOrderAsync(int? Key)
11911191
{
11921192
//Create query to remove the specific from database by passing the primary key column value.

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ Create a controller named **GridController.cs** under the Controllers folder.
5252
Use **SqliteConnection** and **SqliteCommand** to execute queries and populate a collection of model objects.
5353

5454
{% tabs %}
55-
{% highlight razor tabtitle="GridController.cs"%}
55+
{% highlight razor tabtitle="GridController.cs" %}
5656
using Microsoft.AspNetCore.Mvc;
5757
using System.Data;
5858
using System.Data.SqlClient;
@@ -197,7 +197,7 @@ Access the theme stylesheet and script from NuGet using [Static Web Assets](http
197197
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.
198198

199199
{% tabs %}
200-
{% highlight razor tabtitle="Index.razor"%}
200+
{% highlight razor tabtitle="Index.razor" %}
201201
@using Syncfusion.Blazor.Grids
202202
@using Syncfusion.Blazor.Data
203203
@using Syncfusion.Blazor
@@ -259,7 +259,7 @@ The [SfDataManager](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Data
259259
}
260260
}
261261
{% endhighlight %}
262-
{% highlight c# tabtitle="GridController.cs"%}
262+
{% highlight c# tabtitle="GridController.cs" %}
263263
public class GridController : ControllerBase
264264
{
265265
/// <summary>
@@ -697,7 +697,7 @@ Inject a custom service into the `CustomAdaptor` and configure the component as
697697
SfGrid<Order> Grid { get; set; }
698698
}
699699
{% endhighlight %}
700-
{% highlight razor tabtitle="Orderdata.cs"%}
700+
{% highlight razor tabtitle="Orderdata.cs" %}
701701
public class Order
702702
{
703703
public int? OrderID { get; set; }
@@ -1115,7 +1115,7 @@ Each method can be customized to execute SQL commands against the **SQLite Serve
11151115
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.
11161116

11171117
{% tabs %}
1118-
{% highlight razor tabtitle="Index.razor"%}
1118+
{% highlight razor tabtitle="Index.razor" %}
11191119
/// <summary>
11201120
/// Inserts a new data item into the data collection.
11211121
/// </summary>
@@ -1131,7 +1131,7 @@ public override async Task<object> InsertAsync(DataManager DataManager, object V
11311131
return Value;
11321132
}
11331133
{% endhighlight %}
1134-
{% highlight razor tabtitle="Orderdata.cs"%}
1134+
{% highlight razor tabtitle="Orderdata.cs" %}
11351135
public async Task AddOrderAsync(Order Value)
11361136
{
11371137
//Create query to insert the specific into the database by accessing its properties
@@ -1152,7 +1152,7 @@ public async Task AddOrderAsync(Order Value)
11521152
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.
11531153

11541154
{% tabs %}
1155-
{% highlight razor tabtitle="Index.razor"%}
1155+
{% highlight razor tabtitle="Index.razor" %}
11561156
/// <summary>
11571157
/// Updates an existing data item in the data collection.
11581158
/// </summary>
@@ -1169,7 +1169,7 @@ public override async Task<object> UpdateAsync(DataManager DataManager, object V
11691169
return Value;
11701170
}
11711171
{% endhighlight %}
1172-
{% highlight razor tabtitle="Orderdata.cs"%}
1172+
{% highlight razor tabtitle="Orderdata.cs" %}
11731173
public async Task UpdateOrderAsync(Order Value)
11741174
{
11751175
//Create query to update the changes into the database by accessing its properties
@@ -1190,7 +1190,7 @@ public override async Task<object> UpdateAsync(DataManager DataManager, object V
11901190
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.
11911191

11921192
{% tabs %}
1193-
{% highlight razor tabtitle="Index.razor"%}
1193+
{% highlight razor tabtitle="Index.razor" %}
11941194
/// <summary>
11951195
/// Removes a data item from the data collection.
11961196
/// </summary>
@@ -1207,7 +1207,7 @@ public override async Task<object> RemoveAsync(DataManager DataManager, object V
12071207
return Value;
12081208
}
12091209
{% endhighlight %}
1210-
{% highlight razor tabtitle="Orderdata.cs"%}
1210+
{% highlight razor tabtitle="Orderdata.cs" %}
12111211
public async Task RemoveOrderAsync(int? Key)
12121212
{
12131213
//Create query to remove the specific from database by passing the primary key column value.

0 commit comments

Comments
 (0)