You may also examine the resources below: Automatic operations with Sql Data Source control in hierarchical grid Insert/Update/Delete with stored procedures and Sql Data Source control By default Rad Grid extracts the values from the column editors for all columns of the currently edited Grid Item when updating or inserting a new record unless they are set as read-only.
When deleting an item, Rad Grid extracts the values from the cells of the Grid Item that is to be deleted.
Rad Grid provides an API for inserting new data, updating existing data and deleting data from the specified data source.
You can use these features while writing very little code.
" Select Command="SELECT [Order ID], [Customer ID], [Employee ID], [Order Date], [Ship Name] FROM [Orders]" Delete Command="DELETE FROM [Orders] WHERE [Order ID] = @Order ID" Insert Command="INSERT INTO [Orders] ([Customer ID], [Employee ID], [Order Date], [Ship Name]) VALUES (@Customer ID, @Employee ID, @Order Date, @Ship Name)" Update Command="UPDATE [Orders] SET [Customer ID] = @Customer ID, [Employee ID] = @Employee ID, [Order Date] = @Order Date, [Ship Name] = @Ship Name WHERE [Order ID] = @Order ID" The following articles describe how to configure some of the more common Data Source controls: For a tutorial that uses automatic CRUD operations feature, see Add controls to column templates.
For a live example that demonstrates automatic data source operations, see Automatic operations.
In order to achieve this, you need to set the following three properties: The automatic data source operations only work when binding the grid to a declarative data source using the Data Source ID property of the grid.You must configure the data source so that it supports the automatic operations.You also need to set the Data Key Names property of the table views in the grid so that the insert, update, and delete operations perform as expected.Like other data source controls, Object Data Source supports declarative parameters to allow developers to pass page-level variables to the object s methods.The Object Data Source control is not the panacea of all Web data access issues.
NET Entity Data Model โดลคลิกควาที่ Project เลือก Add New Item เลือก ASP.