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.
Unfortunately, activation email could not send to your email. Please try again.

perform crud operation with server side events with sqlserver

Thread ID:

Created:

Updated:

Platform:

Replies:

125098 Jul 21,2016 05:07 AM Jul 22,2016 09:17 AM ASP.NET Web Forms 1
loading
Tags: Grid
sharad
Asked On July 21, 2016 05:07 AM

Hi

I want to bind grid on page load with my sqlserver database and do the insert, update ,delete, cancel,save  operation  in grid in inline form edit mode so that effects shows on sqlserver database.

thank you.

Jayaprakash Kamaraj [Syncfusion]
Replied On July 22, 2016 09:17 AM

Hi Sharad, 

Thank you for contacting Syncfusion support. 

As per our understanding about your requirement, you would like to update database while perform crud operation in Grid. In Grid, we have many adaptors to perform crud operations and update the database. Refer to the below document for information about adaptors. 
We have created a sample using WebMethodAdaptor with EditMode as InlineForm. Refer to the help document, sample & code example as below. 
<ej:Grid ID="EmployeesGrid" runat="server AllowPaging="true" > 
                <DataManager URL="Default.aspx/Data" Adaptor="WebMethodAdaptor" UpdateURL="Default.aspx/Update" InsertURL="Default.aspx/Add" RemoveURL="Default.aspx/Remove" /> 
                <EditSettings AllowEditing="true" AllowAdding="true" AllowDeleting="true" EditMode="InlineForm" />              
                <Columns> 
                        <ej:Column Field="OrderID" IsPrimaryKey="true" HeaderText="Order ID" Width="80" /> 
.. 
                    </Columns>                
            </ej:Grid> 
Default.aspx.cs 
// URL Adaptor using server side  
        [WebMethod] 
        [ScriptMethod(ResponseFormat = ResponseFormat.Json)] 
        public static object Data(Syncfusion.JavaScript.DataManager value) 
        { 
.. 
            Data = operation.Execute(Data, value);// Execute used for for manual typecasting of columns value while filtering, sorting, or any other data operation 
            return new { result = Data, count = count }; // need to return result and count pair  
        } 
        // Perform Update action 
      [WebMethod] 
        [ScriptMethod(ResponseFormat = ResponseFormat.Json)] 
        public static object Update(Order value) 
      { 
//  code for update operation 
      .. 
 
      } 
// Perform Delete action 
      [WebMethod] 
      [ScriptMethod(ResponseFormat = ResponseFormat.Json)] 
      public static object Delete(int key) 
      { 
          .. //  code for delete operation 
 
      } 
        // Perform Add action 
      [WebMethod] 
      [ScriptMethod(ResponseFormat = ResponseFormat.Json)] 
      public static object Add(Order value) 
      { 
.. //  code for add operation 
      } 
 
knowledgebase document for server-side operations : https://www.syncfusion.com/kb/4300/server-side-api-for-datamanager-operations 
Regards, 
Jayaprakash K. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;