开发者

How to Improvement on Data retrieval from Database in Classic ASP?

My application is in Classic ASP. Currently SAVE functionality is taking around 30sec to complete and the process is:

  1. Reads the data from UI.
  2. Send to the Database.
  3. Retrieve saved data again from database to populate UI. I need some other way to improve the performance by less then 10sec. e.g:
  4. Us开发者_运维百科ing XML and web services, but I do not want to save the xml file temporarily in the system.
  5. Using JQuery and Ajax . Please suggest me which one is feasible and will take less effort to code also less maintainable. Please provide me any code or reference if anyone have. As I do not have any experience in XML or JQuery or Ajax.


If you wanted more detail answer, please describe how you do your process now.

There are several reasons why your the process take too long, for example:

  1. Connection between your database and we application server.
  2. How your code written for retrieving or updating the database.
  3. What provider do you use for database connection.
  4. Are there a lot of stuff to update, what kind of data.

and many more.

For jQuery ajax sample (This is Ajax call with jQuery function):

<script type="text/javascript">
    //this is for handling the button click event
    $(function () {
        $("#btnTest").click(function () {
            //this is to call the function if click was initiated
            AjaxTest();
        });
    };

    function AjaxTest() {
        //this is variable to collect data
        var _ajaxData= { firstName: "John", lastName: "Smith", email: "john.smith@whatnot.com" };

        //this is the main ajax function, it basically send the collected data
        //to AjaxProcessPage.aspx and response back
        $.post("AjaxProcessPage.aspx", _ajaxData, function (data) {
            if (data.status == "ok") {
                alert("Data is ok");
            };
        });
    }
</script>

<body>
<input type="button" name="btnTest" id="btnTest" />
</body>

Explanation are in the comment, this is basically the client-side. When data are sent to AjaxProcessPage.aspx, you can insert your process on that page.

For more information about jQuery Ajax: http://api.jquery.com/category/ajax/

For more information about $.post() function of jQuery that I used: http://api.jquery.com/jQuery.post/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜