如何减少在Web应用程序中保存数据的时间 [英] How to reduce the time in saving the data in web application

查看:118
本文介绍了如何减少在Web应用程序中保存数据的时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的,



我有一个托管在远程服务器上的Web应用程序,而sql server 2012只安装在那里。我通过互联网从其他系统访问该应用程序。当我做一些更改并保存数据时,需要花费太多时间。如何减少保存数据的时间。





问候,

Venga

解决方案

< blockquote>在Web应用程序中,用户正在使用带有输入控件的网页,用户输入其输入,然后按保存(峰值)按钮。所以我看到两个改进的地方:



1.因为每次按下峰值按钮时,整个网页及其所有内容都会被发送回Web服务器(执行Web应用程序的地方),你可以通过使用 jQuery AJAX 调用来优化它。通过仅发送用户输入的值。



2.在服务器代码上,当通过 jQuery调用Save方法时 AJAX ,您只需通过ID(或当前实体主键)搜索数据库,该实体必须保存,然后设置作为参数的值(应包含用户输入),最后将其保存到数据库中。为此,您可以使用带有参数的存储过程或SQL命令的实体框架, ADO.NET


从您的问题我们无法判断您的时间消耗的代码。

因此,为了开发最佳网站,您应该记住一些要点。



见以下链接: -

ASP.NET优化 [ ^ ]

http:// msdn。 microsoft.com/en-us/library/aa719563(v=vs.71).aspx [ ^ ]

http://msdn.microsoft.com/en-us/library/5dws599a(v = vs.71)的.aspx [< a href =http://msdn.microsoft.com/en-us/library/5dws599a(v=vs.71).aspx\"target =_ blanktitle =New Window> ^ ] < br $> b $ b



或调试你的代码并找出需要更多时间的地方并重新发布。


尝试提高你的SQL查询性能,你可以在谷歌找到教程和指南.. :)

读这个.. :)



查询性能调优(SQL Server Compact) [ ^ ]



7表现更快的SQL查询提示 [ ^ ]



提高查询性能 [ ^ ]



提高SQL查询性能的10种方法 [ ^ ]

Dear all,

I have a web application which is hosted on remote server and sql server 2012 is installed ove there only. i access the application from some other system over internet. When i do some changes and save the data it takes too much time. How to reduce the time in saving the data.


Regards,
Venga

解决方案

In the web application, the user is using a web page with input controls, where the user enter its inputs and then press a "Save" (summit) button. So I see two place of improvement:

1. Because each time time when a summit button is pressed, the entire web page with all its content is send it back to the web server (where the web application is executed), you could optimize this, by using jQuery and AJAX call and by sending only the values of the user inputs.

2. On the server code, when the "Save" method invoked via jQuery and AJAX, you have just to search on the database via ID (or the current entity primary key) the entity that has to be save, then set the values that come as parameter (that should contain the user inputs), and finally save it into the database. To to this you could use Entity Framework, or ADO.NET with stored procedure or SQL commands with parameters.


From your question we can't judge the code where your time gets consume.
So, for to develop optimum site you should remember some points.

See below links:-
ASP.NET Optimization[^]
http://msdn.microsoft.com/en-us/library/aa719563(v=vs.71).aspx[^]
http://msdn.microsoft.com/en-us/library/5dws599a(v=vs.71).aspx[^]


or debug your code and find out where it takes more time and post again.


try to improve your sql query performance, you can find tutorials and guidelines on google.. :)
read this.. :)

Query Performance Tuning (SQL Server Compact)[^]

7 performance tips for faster SQL queries[^]

Improving Query Performance[^]

10 Ways to Improve SQL Query Performance[^]


这篇关于如何减少在Web应用程序中保存数据的时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆