save problem

I use sql statement to update the DBconnector.

And load the sql into a grid XML.



  var editsql;

editsql =  "DBConnector.ashx?strSQL=UPDATE MASTER_PARAMETER_DEF SET FIELD_DISPLAY_NAME = '" + string_edit_fieldname + "' WHERE TABLE_TYPE = '" + search_a + " ' " ;
 


  var hiddengrid_window = dhxWins.createWindow('hiddengrid_window', 0, 0, 640, 480);
       
   var result_grid1 = hiddengrid_window.attachGrid();

        result_grid1.setHeader("Display Name");
   
        result_grid1.init();

       result_grid1.loadXML(editsql);

Using the above code, I can save the data to DBconnector but it must pop the error message.

Otherwise, I use same method for < insert > and < select > SQL startment for operation but it is ok.

How about the problem ?

You need to escape special chars

editsql = "DBConnector.ashx?strSQL="+encodeURIComponent("UPDATE MASTER_PARAMETER_DEF SET FIELD_DISPLAY_NAME = '" + string_edit_fieldname + "' WHERE TABLE_TYPE = '" + search_a + " ' ");