Skip to content

SyncfusionExamples/connecting-databases-to-aspnetmvc-grid

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

Connecting Databases to Syncfusion ASP.NET MVC Grid

Repository Description

A suite of projects that enable data binding and CRUD action handling in the Syncfusion ASP.NET MVC Grid from various databases using CustomAdaptor and UrlAdaptor.

Overview

The connecting-databases-to-aspnetmvc-grid repository provides a collection of focused examples designed to help developers understand different data binding and integration patterns supported by the Syncfusion EJ2 ASP.NET MVC Grid. Each sample is organized by scenario, making it easier to explore and learn specific approaches without unnecessary complexity.

The samples primarily focus on connecting the Grid component with databases, adapters, and backend services commonly used in modern web applications. These examples are intended for developers who want practical references while building enterprise-grade applications using Syncfusion components.

Prerequisites

To run this sample, ensure you have the following installed:

  • Visual Studio with ASP.NET MVC support
  • .NET Framework compatible with ASP.NET MVC
  • A configured database (as referenced in the project)
  • Syncfusion ASP.NET MVC components

Using UrlAdaptor

The UrlAdaptor serves as the base adaptor for facilitating communication between remote data services and a UI component. It enables the remote binding of data to the Syncfusion Angular Grid by connecting to an existing, pre-configured API service linked to the Microsoft SQL Server database. While the Grid supports various adaptors to fulfill this requirement, including Web API, ODataV4, UrlAdaptor, and Web Method, the UrlAdaptor is particularly useful for scenarios where a custom API service with unique logic for handling data and CRUD operations is in place. This approach allows for custom handling of data and CRUD operations, and the resultant data is returned in the result and count format for display in the Grid.

Using CustomAdaptor

The CustomAdaptor serves as a mediator between the UI component and the database for data binding. While the data source from the database can be directly bound to the Syncfusion Angular Grid locally using the dataSource property, the CustomAdaptor approach is preferred as it allows for customization of both data operations and CRUD operations according to specific requirements. In this approach, for every action in the Grid, a corresponding request with action details is sent to the CustomAdaptor. The Grid provides predefined methods to perform data operations such as searching, filtering, sorting, aggregation, paging, and grouping. Alternatively, your own custom methods can be employed to execute operations and return the data in the result and count format for displaying in the Grid. Additionally, for CRUD operations, predefined methods can be overridden to provide custom functionality. Further details on this can be found in the later part of the documentation.

Running the Application

  1. Clone or download the repository.
  2. Open the solution file in Visual Studio.
  3. Restore NuGet packages if required.
  4. Update the database connection string in the configuration file.
  5. Build and run the application

Resources

About

A suite of projects that enable data binding and CRUD action handling in the Syncfusion aspnetmvc Grid from various databases using CustomAdaptor and UrlAdaptor.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors