In Gantt, we can load data from SQL database using ADO.NET Entity Data Model and can update the changes to the SQL database on CRUD operations.
Please refer following link to create the ADO.NET Entity Data Model in Visual studio,
SQL database connection in Gantt can be established by using data model entity class. The Data Model entity class name is used as the connectionString name to establish the connection with the SQL database. The ‘connectionStrings’ will be automatically create in our web.config file once entity data model generated.
Please refer following code snippet for adding SQL connection in web.config
CRUD actions are performed by entity classes to update Gantt data using the client side event and with AJAX post method. The event argument requestType of the ActionComplete client side event is used to identify the type of action performed in Gantt such as update, delete, add new task. Please refer the below code example for updating the changes to the SQL database.
Controller Code [C#]:
Creating Gantt object
Connecting SQL database and fetching records from database:
Add method to add new tasks to SQL database:
Update method to update the changes from Gantt to SQL database:
Delete method to delete the tasks from SQL database
|Article ID:||Published Date:||Last Revised Date:||Platform:||Control:|