使用下面的代码行的任何其他替代而不是for循环 [英] Any other alternate instead of for loop using the below lines of code

查看:58
本文介绍了使用下面的代码行的任何其他替代而不是for循环的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我在我的页面中写了这行代码,因为我的浏览器性能已经下降了。有没有其他选择来增加我的浏览器性能



这里我正在使用for循环但在我的数据表有5000条记录,我的浏览器性能被压缩。



但是我想从我的数据表中读取所有Doc_Id,Revision详细信息。



Hi everybody,

I wrote this lines of code in my page for this my browser performence is decressed. Is there any other option to increase my browser performence

here i''m using for loop but in my datatable having 5000 records for this my browser performence is decressed.

But i want to read all the Doc_Id, Revision details from my datatable.

for (int i = 0; i < dsDocument.Tables[0].Rows.Count; i++)
{
    string Doc_Id = dsDocument.Tables[0].Rows[i]["Doc_Id"].ToString();
    string Revision = dsDocument.Tables[0].Rows[i]["Dwg_Rev_No"].ToString();
    string Query = "<Where>" +
                    "<And><Eq><FieldRef Name='Dwg_No'/><Value Type='Text'>" + Doc_Id + "</Value></Eq>" +
                    "<Eq><FieldRef Name='Dwg_Rev_No'/><Value Type='Text'>" + Revision + "</Value></Eq></And>" +
                                 "</Where>";
    dtDrawing = objFile.ListContent(objCurrentSite.SiteURL, objCurrentSite.WebSiteName, "Drawing", Query);

    dt.Merge(dtDrawing);
    dt.AcceptChanges();
}

推荐答案

从网页更新5000条记录会被延迟。这是你的核心问题。无论你怎么做,都需要时间。如果你必须这样做,那就不要在页面生命周期中这样做,请服务人员去做。
Updating 5000 records from a web page is retarded. That is your core issue. No matter how you do it, it will take time. If you must do it, then don''t do it in the page lifecycle, ask a service to do it.


这篇关于使用下面的代码行的任何其他替代而不是for循环的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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