Save to Sqlserver Database

Last post 02-06-2012, 2:49 AM by Amjad Sahi. 1 replies.
Sort Posts: Previous Next
  •  02-03-2012, 2:59 PM 359248

    Save to Sqlserver Database .NET

    1. I need to save edited values to sqlserver database on save button onclick event (Not meaning submit button in the command bar at the bottom) its the server side button outside the grid control

    2. How to hide command bar at the bottom of grid completely.

     

     

     
  •  02-06-2012, 2:49 AM 359391 in reply to 359248

    Re: Save to Sqlserver Database

    Hi,

    We think you are using GridWeb control.

    1) We think if you want to save the data / updated data, you can use:  
    GridWeb1.WebWorksheets.SaveToExcelFile([Memory Stream])
    So, the WebWorksheets can store data to a Stream. Now, you have to use your own code to update the data on the back end after saving the Excel workbook to Streams.

    E.g

    First you will create an Asp.NEt "button",
    for the button's click event, store data to memory stream by calling  the method: this.GridWeb1.WebWorksheets.SaveToExcelFile([Memory Stream])
    then, store memory stream to database by using your own .NET code.
    Also if you use your own Asp.Net button, then you have to add a line for the button to sink GridWeb's updated data/events, for example, you may add this line for the button into the Form_Load event: 

     if (!IsPostBack)

    {

    Button1.Attributes["onclick"] = "GridWeb1.updateData(); return GridWeb1.validateAll();";
     }

    2) You may try the methods of GridWeb, e.g

    GridWeb1.ShowSaveButton = "false";
    GridWeb1.ShowBottomBar = "false";
     etc...


    Thank you.

    Amjad Sahi
    Support Developer,
    Aspose Sialkot Team
    Contact Us
     
View as RSS news feed in XML