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
Copy file name to clipboardExpand all lines: Binding MS SQL database using CustomAdaptor/Blazor Web app/Grid_MSSQL/Grid_MSSQL/Grid_MSSQL/Data/OrderData.cs
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ namespace Grid_MSSQL.Data
5
5
{
6
6
publicclassOrderData
7
7
{
8
-
//Enter the connectionstring of database
8
+
//TODO: Enter the connectionstring of database
9
9
publicstringConnectionString=@"<Enter a valid connection string>";
Copy file name to clipboardExpand all lines: Binding MS SQL database using UrlAdaptor/Blazor WASM app/MyWebService/MyWebService/Controllers/GridController.cs
+6-8Lines changed: 6 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -55,23 +55,21 @@ public object Post([FromBody] DataManagerRequest DataManagerRequest)
//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.
61
59
// In the above case we are using Paging so data are loaded in ondemand bases whenever the next page is clicked in DataGrid side.
stringConnectionString=@"<Enter a valid connection string>";
69
67
stringQueryStr="SELECT * FROM dbo.Orders ORDER BY OrderID;";
70
68
SqlConnectionsqlConnection=new(ConnectionString);
71
69
sqlConnection.Open();
72
70
//Initialize the SqlCommand
73
71
SqlCommandSqlCommand=new(QueryStr,sqlConnection);
74
-
//Initialize the SqlDataAdapter
72
+
//initialize the SqlDataAdapter
75
73
SqlDataAdapterDataAdapter=new(SqlCommand);
76
74
DataTableDataTable=new();
77
75
// Using SqlDataAdapter, process the query string and fill the data into the dataset
@@ -100,7 +98,7 @@ public List<Order> GetOrderData()
100
98
/// <returns>Returns void</returns>
101
99
publicvoidInsert([FromBody]CRUDModel<Order>Value)
102
100
{
103
-
//Enter the connectionstring of database
101
+
//TODO: Enter the connectionstring of database
104
102
stringConnectionString=@"<Enter a valid connection string>";
105
103
//Create query to insert the specific into the database by accessing its properties
106
104
stringQuery=$"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)
122
120
/// <returns>Returns void</returns>
123
121
publicvoidUpdate([FromBody]CRUDModel<Order>Value)
124
122
{
125
-
//Enter the connectionstring of database
123
+
//TODO: Enter the connectionstring of database
126
124
stringConnectionString=@"<Enter a valid connection string>";
127
125
//Create query to update the changes into the database by accessing its properties
128
126
stringQuery=$"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)
148
146
/// <returns>Returns void</returns>
149
147
publicvoidDelete([FromBody]CRUDModel<Order>Value)
150
148
{
151
-
//Enter the connectionstring of database
149
+
//TODO: Enter the connectionstring of database
152
150
stringConnectionString=@"<Enter a valid connection string>";
153
151
//Create query to remove the specific from database by passing the primary key column value.
154
152
stringQuery=$"Delete from Orders where OrderID={Value.Key}";
@@ -169,7 +167,7 @@ public void Delete([FromBody] CRUDModel<Order> Value)
169
167
/// <returns>Returns void</returns>
170
168
publicvoidBatch([FromBody]CRUDModel<Order>Value)
171
169
{
172
-
//Enter the connectionstring of database
170
+
//TODO: Enter the connectionstring of database
173
171
stringConnectionString=@"<Enter a valid connection string>";
Copy file name to clipboardExpand all lines: Binding MS SQL database using UrlAdaptor/Blazor Web app/Grid_MSSQL/Grid_MSSQL/Grid_MSSQL/Controllers/GridController.cs
0 commit comments