Skip to content

Commit db355eb

Browse files
vignesh.natarajan@syncfusion.comvignesh.natarajan@syncfusion.com
authored andcommitted
added comments
1 parent 232a049 commit db355eb

File tree

3 files changed

+8
-10
lines changed
  • Binding MS SQL database using CustomAdaptor/Blazor Web app/Grid_MSSQL/Grid_MSSQL/Grid_MSSQL/Data
  • Binding MS SQL database using UrlAdaptor

3 files changed

+8
-10
lines changed

Binding MS SQL database using CustomAdaptor/Blazor Web app/Grid_MSSQL/Grid_MSSQL/Grid_MSSQL/Data/OrderData.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ namespace Grid_MSSQL.Data
55
{
66
public class OrderData
77
{
8-
//Enter the connectionstring of database
8+
//TODO: Enter the connectionstring of database
99
public string ConnectionString = @"<Enter a valid connection string>";
1010
public async Task<List<Order>> GetOrdersAsync()
1111
{

Binding MS SQL database using UrlAdaptor/Blazor WASM app/MyWebService/MyWebService/Controllers/GridController.cs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,23 +55,21 @@ public object Post([FromBody] DataManagerRequest DataManagerRequest)
5555
{
5656
DataSource = DataOperations.PerformTake(DataSource, DataManagerRequest.Take);
5757
}
58-
DataResult DataObject = new DataResult();
59-
6058
//Here RequiresCount is passed from the control side itself, where ever the ondemand data fetching is needed then the RequiresCount is set as true in component side itself.
6159
// In the above case we are using Paging so data are loaded in ondemand bases whenever the next page is clicked in DataGrid side.
6260
return new { result = DataSource, count = count, aggregates = Aggregates };
6361
}
6462
[Route("api/[controller]")]
6563
public List<Order> GetOrderData()
6664
{
67-
//Enter the connectionstring of database
65+
//TODO: Enter the connectionstring of database
6866
string ConnectionString = @"<Enter a valid connection string>";
6967
string QueryStr = "SELECT * FROM dbo.Orders ORDER BY OrderID;";
7068
SqlConnection sqlConnection = new(ConnectionString);
7169
sqlConnection.Open();
7270
//Initialize the SqlCommand
7371
SqlCommand SqlCommand = new(QueryStr, sqlConnection);
74-
//Initialize the SqlDataAdapter
72+
//initialize the SqlDataAdapter
7573
SqlDataAdapter DataAdapter = new(SqlCommand);
7674
DataTable DataTable = new();
7775
// Using SqlDataAdapter, process the query string and fill the data into the dataset
@@ -100,7 +98,7 @@ public List<Order> GetOrderData()
10098
/// <returns>Returns void</returns>
10199
public void Insert([FromBody] CRUDModel<Order> Value)
102100
{
103-
//Enter the connectionstring of database
101+
//TODO: Enter the connectionstring of database
104102
string ConnectionString = @"<Enter a valid connection string>";
105103
//Create query to insert the specific into the database by accessing its properties
106104
string Query = $"Insert into Orders(CustomerID,Freight,ShipCity,EmployeeID) values('{Value.Value.CustomerID}','{Value.Value.Freight}','{Value.Value.ShipCity}','{Value.Value.EmployeeID}')";
@@ -122,7 +120,7 @@ public void Insert([FromBody] CRUDModel<Order> Value)
122120
/// <returns>Returns void</returns>
123121
public void Update([FromBody] CRUDModel<Order> Value)
124122
{
125-
//Enter the connectionstring of database
123+
//TODO: Enter the connectionstring of database
126124
string ConnectionString = @"<Enter a valid connection string>";
127125
//Create query to update the changes into the database by accessing its properties
128126
string Query = $"Update Orders set CustomerID='{Value.Value.CustomerID}', Freight='{Value.Value.Freight}',EmployeeID='{Value.Value.EmployeeID}',ShipCity='{Value.Value.ShipCity}' where OrderID='{Value.Value.OrderID}'";
@@ -148,7 +146,7 @@ public void Update([FromBody] CRUDModel<Order> Value)
148146
/// <returns>Returns void</returns>
149147
public void Delete([FromBody] CRUDModel<Order> Value)
150148
{
151-
//Enter the connectionstring of database
149+
//TODO: Enter the connectionstring of database
152150
string ConnectionString = @"<Enter a valid connection string>";
153151
//Create query to remove the specific from database by passing the primary key column value.
154152
string Query = $"Delete from Orders where OrderID={Value.Key}";
@@ -169,7 +167,7 @@ public void Delete([FromBody] CRUDModel<Order> Value)
169167
/// <returns>Returns void</returns>
170168
public void Batch([FromBody] CRUDModel<Order> Value)
171169
{
172-
//Enter the connectionstring of database
170+
//TODO: Enter the connectionstring of database
173171
string ConnectionString = @"<Enter a valid connection string>";
174172
if (Value.Changed != null)
175173
{

Binding MS SQL database using UrlAdaptor/Blazor Web app/Grid_MSSQL/Grid_MSSQL/Grid_MSSQL/Controllers/GridController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ namespace Grid_MSSQL.Controllers
1212
[ApiController]
1313
public class GridController : ControllerBase
1414
{
15-
//Enter the connectionstring of database
15+
//TODO: Enter the connectionstring of database
1616
string ConnectionString = @"<Enter a valid connection string>";
1717
[HttpPost]
1818
[Route("api/[controller]")]

0 commit comments

Comments
 (0)