在Asp.net中运行存储过程 [英] Run Store Procedure in Asp.net

查看:65
本文介绍了在Asp.net中运行存储过程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个表,其中包含sql server数据库中的1000条记录,

如果花15秒运行一个选择命令并在页面加载事件中将其记录绑定到Gridview中.

所以有什么方法可以将这种情况从15秒减少到2秒

I have table which contain 1000 records in sql server Database,

if it is taking 15 second to run a select a command and bind it''s record in Gridview on page load event.

so is there any way to reduce this 15 second to 2 second for aboce situation

推荐答案

您可以使用Sql分页来解决此问题
You can Use Sql paging to solve this problem


使用分页.
http://msdn.microsoft.com/en-us/library/aa479347.aspx [ ^ ]
use pagination.
http://msdn.microsoft.com/en-us/library/aa479347.aspx[^]


您好,

我对您的要求的建议是

我们无法在单个页面上显示全部1000条记录.

对于这种情况,我会尽力而为...

首先,我从数据库中获得了100条记录,并将其存储到应用程序变量中

之后,检索101-200条记录,然后保存在应用程序变量中.

如果用户想要的还不止这些,我将从应用程序变量中删除我的第一个功能强大的结果.

确保网站不要浪费时间从数据库中检索数据.


最好的
Hi,

My suggestion for your requirement is

we cannot show entire 1000 records on single page.

I do my way for this situation like...

first I got 100 records from database and store into application variable

After that retrieve 101-200 records and then save in application variable.

if user wants more than that I just remove my first feteched results from application variable.

Make sure website don''t waste time for retrieving data from database.


All the Best


这篇关于在Asp.net中运行存储过程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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