Giter Club home page Giter Club logo

syncfusionexamples / connecting-databases-to-blazor-datagrid-component Goto Github PK

View Code? Open in Web Editor NEW
0.0 3.0 0.0 6.11 MB

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

HTML 42.01% C# 33.12% CSS 24.63% JavaScript 0.23%
blazor blazor-grid blazor-server blazor-web-app blazor-webassembly datagrid grid microsoft-sql-server syncfusion syncfusion-blazor

connecting-databases-to-blazor-datagrid-component's Introduction

Connecting Databases To Blazor dataGrid Component

This section describes how to connect and retrieve data from a Microsoft SQL Server database using System.Data.SqlClient and bind it to the Blazor DataGrid component.

Microsoft SQL Server database can be bound to the Blazor DataGrid in different ways (i.e.) using DataSource property, CustomAdaptor feature and Remote data binding using various adaptors (Web API, OData, ODataV4, Url, GraphQL). In this documentation, two approaches will be examined to connect a Microsoft SQL Server database to a Blazor DataGrid component. Both the approaches have capability to handle data and CRUD operations with built-in methods as well as can be customized as per your own.

  • 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 Blazor SfGrid component by connecting to an existing pre-configured API service linked to the Microsoft SQL Server database. While the Blazor DataGrid supports various adaptors to fulfill this requirement, including Web API, OData, ODataV4, Url, and GraphQL, 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 returned in the result and count format for display in the Blazor SfGrid component.

  • 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 SfGrid component 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 Blazor SfGrid component, a corresponding request with action details is sent to the CustomAdaptor. The Blazor DataGrid provides predefined methods such as PerformSearching, PerformFiltering, PerformSorting, PerformAggregation, PerformSkip, PerformTake and Group for executing these data operations. Alternatively, your own custom methods can be employed to execute operations and return the data in the Result and Count format of the DataResult class for display in the Blazor SfGrid component. Additionally, for CRUD operations, predefined methods can be overridden to provide custom functionality. Further details on this can be found in the latter part of the documentation.

Here, we have explained in detail how to bind the listed databases below to the Blazor DataGrid component using CustomAdaptor and UrlAdaptor.

  1. Microsoft SQL Server Database
  2. MYSQL Database
  3. PostgreSQL Database
  4. Dapper
  5. SQLite

connecting-databases-to-blazor-datagrid-component's People

Contributors

edberg-vasan avatar maithiliyk avatar syncfusionbuild avatar vigneshnatarajan27 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.