We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Grid - Custom Adaptor- CRUD "Add/Update/Delete" SQL SERVER

Hello, can you please give me an example(Server side Blazor) of  "CustomAdaptor" for update/insert/delete in SQL server. (not Api with Entity Framework (EF) Core) 

It would be a great help for me.


1 Reply

RS Renjith Singh Rajendran Syncfusion Team October 4, 2019 11:28 AM UTC

Hi Piet, 

Thanks for contacting Syncfusion support. 

Based on your requirement, we have prepared a custom adaptor sample by binding the SQL Server without Entity Framework. Please download the sample form the link below, 
 
We suggest you to refer to the below documentation for more details regarding custom adaptor in Grid. 
 
You have to extend a class from the DataAdaptor and in that class we will have inbuilt override methods Read/ReadAsync, Insert/InsertAsync, Remove/RemoveAsync, Update/UpdateAsync, BatchUpdate/BatchUpdateAsync to perform customized actions in Grid. You can perform your own customized query operations for the corresponding actions by using the “Insert”, ”Remove”, “Update” methods and then return the value. Please refer the code below, 

 
   public class CustomAdaptor : DataAdaptor 
   { 
        ... 
        public override object Insert(DataManager dm, object value, string key) 
        { 
            //Perform your custom sql query operations for insert operation here 
            ... 
            return value; 
        } 
        public override object Remove(DataManager dm, object value, string keyField, string key) 
        { 
            //Perform your custom sql query operations for remove operation here 
            ... 
            return value; 
        } 
       public override object Update(DataManager dm, object value, string keyField, string key) 
        { 
            //Perform your custom sql query operations for update operation here 
            ... 
           return value; 
        } 
    } 


Please get back to us if you need further assistance. 

Regards, 
Renjith Singh Rajendran. 


Loader.
Live Chat Icon For mobile
Up arrow icon