An Overview of Inserting, Updating, and Deleting examined using the Object Data Source to facilitate inserting, updating, and deleting with the Grid View, Details View, and Form View controls.

Alternatively, the Sql Data Source can be used in place of the Object Data Source.

The following diagram shows the typical structure of an e Connect SQL stored procedure that creates or updates a document.

stored procedure insert not updating database-2

section if you are using Entity Framework 5.0 with VS2012.

If you have existing stored procedures to Insert, Update and Delete the record in the database table then you can use those stored procedures for the CUD operation instead of the entity framework's default saving mechanism using Entity Set.

Next, how we can use stored procedure to insert, update and delete the student records in the database will be demonstrated.

First, you have to write a stored procedure for Insert, Update and Delete for student.

To complete a create, update, or delete operation, the Dynamics GP Service framework sends an XML document to e Connect.

The XML document specifies the name of the SQL stored procedure and contains XML nodes that supply data for the input parameters of the stored procedure.

Recall that to support inserting, updating, and deleting, with the Object Data Source we needed to specify the object layer methods to invoke to perform the insert, update, or delete action.

With the Sql Data Source, we need to provide SQL statements (or stored procedures) to execute.

As discussed in An Overview of Inserting, Updating, and Deleting, the Grid View control provides built-in updating and deleting capabilities, while the Details View and Form View controls include inserting support along with editing and deleting functionality.