Asp classic 如何改进经典ASP中的数据库数据检索?
我的应用程序是在经典的ASP。目前,保存功能大约需要30秒才能完成,过程如下:Asp classic 如何改进经典ASP中的数据库数据检索?,asp-classic,Asp Classic,我的应用程序是在经典的ASP。目前,保存功能大约需要30秒才能完成,过程如下: 从UI读取数据 发送到数据库 再次从数据库检索保存的数据以填充UI。 我需要一些其他的方法来提高性能不到10秒。 e、 g: 使用XML和web服务,但我不想在系统中临时保存XML文件 使用JQuery和Ajax。 请告诉我哪一个是可行的,并且代码编写的工作量更少,可维护性也更低。 请提供我任何代码或参考,如果有人有。因为我在XML、JQuery或Ajax方面没有任何经验 如果您想要更详细的答案,请描述您现在是如何完
如果您想要更详细的答案,请描述您现在是如何完成流程的 这一过程耗时过长的原因有几个,例如:
//这用于处理按钮单击事件
$(函数(){
$(“#btnTest”)。单击(函数(){
//这是在单击启动时调用函数
AjaxTest();
});
};
函数AjaxTest(){
//这是用于收集数据的变量
var_ajaxData={姓氏:“约翰”,姓氏:“史密斯”,电子邮件:“约翰。smith@whatnot.com" };
//这是ajax的主要功能,它基本上发送收集的数据
//转到AjaxProcessPage.aspx并返回响应
$.post(“AjaxProcessPage.aspx”,_ajaxData,函数(数据){
如果(data.status==“正常”){
警报(“数据正常”);
};
});
}
注释中有解释,这基本上是客户端。当数据发送到AjaxProcessPage.aspx时,您可以在该页面上插入流程
有关jQuery Ajax的更多信息:
有关我使用的jQuery的$.post()函数的更多信息:
嗯,您需要在sql事件探查器中进行跟踪,看看您的sql是否在30秒内占用了25秒:p
<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>