我只想打数据库一次,即使行数是100 [英] I want to Hit Database only one Time Even the Rows is 100

查看:79
本文介绍了我只想打数据库一次,即使行数是100的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的朋友,

在这里,iam面临一个典型的问题.实际上在我的项目中,我有100个文本框.现在,iam仅填充前10个文本框,我将访问数据库.然后再填充10个文本框,它将再次访问数据库.还有其他减少网络流量的最佳方法.


问候,

Anilkumar.D

Dear Friends,

Here iam Facing a Typical Problem.Actually in My Project i Have 100 TextBoxs.Now iam Filling only first 10 textboxes i Will hit the Database.And after that another 10 textboxes once again it wil Hit the Database.Iam thinking that its Not that Good way.So is there any Other Best Way to Reduce the Network traffic.


Regards,

Anilkumar.D

推荐答案

对于您的解决方案,您需要这样做..

1)首先,只有第一个击中的记录才能从数据库中获取100条记录...
2)使用数据集,您需要将所有记录填充到数据集中..
3)现在从数据集中创建一个表并从中获取前10条记录..然后是下10条,然后是下10条...
因此,使用ADO.NET可以减少数据库调用并为其使用断开连接的体系结构优势,因此您的网络流量将根据您的要求而减少....

有关ADO.NET的更多信息,请参见此链接...

http://msdn.microsoft.com/en-us/library/ms971481.aspx [ ^ ]

为初学者使用ADO.NET [
For your solution you need to do like this..

1) First of all all the 100 record will fetch from database in only fist hit...
2) using data set you need to fill that all record to your data set..
3) now create one table from data set and fetch first 10 record from it.. then next 10 then next 10...
so using ADO.NET you can reduce your data base call and use a disconnected architecture benefit for it so your network traffic will reduce as per your requirement....

for more information on ADO.NET please see this links...

http://msdn.microsoft.com/en-us/library/ms971481.aspx[^]

Using ADO.NET for beginners[^]


使用Dataset,这是断开连接的设计.帮助您完成任务.仅命中一次数据库,即可获取数据集中的所有数据,并在需要时使用它.
Use Dataset, which is disconnected design. help you to accomplish your task. Hit only one time to database and fetch all data in dataset and use it whenever you want.


这篇关于我只想打数据库一次,即使行数是100的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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