.NET开发

本类阅读TOP10

·NHibernate快速指南(翻译)
·vs.net 2005中文版下载地址收藏
·【小技巧】一个判断session是否过期的小技巧
·VB/ASP 调用 SQL Server 的存储过程
·?dos下编译.net程序找不到csc.exe文件
·通过Web Services上传和下载文件
·学习笔记(补)《.NET框架程序设计(修订版)》--目录
·VB.NET实现DirectDraw9 (2) 动画
·VB.NET实现DirectDraw9 (1) 托管的DDraw
·建站框架规范书之——文件命名

分类导航
VC语言Delphi
VB语言ASP
PerlJava
Script数据库
其他语言游戏开发
文件格式网站制作
软件工程.NET开发
最近在使用sps类库过程中发现了一个让我比较疑惑的问题(有关items属性的)

作者:未知 来源:月光软件站 加入时间:2005-2-28 月光软件站

大家都知道 SPList对象有个属性 items ,在文档中是这样解释的

The Items property of the SPList class gets the collection of all items in the list. Remarks返回当前 List中的所有的item对象集合

The Items property returns all the files in a document library, including files in subfolders, but not the folders themselves. In a document library, folders are not considered items. 在一个document library(文档库)中返回其下所有的文件不包括其目录。

我们在做一个项目,使用wss做后台存储,开发环境数据库中现在有大概2G多的数据,其中主要用的是list 和 document library  站点下大概有查不多1000来个list和 document library ,测试发现性能极其差,每个操作大都需要几秒钟左右,后来反复测试才发现问题处在---- List.Items 属性返回 的时间大概都要用4秒来钟,这弱智得东西,这不是坑人嘛。后来我把这个属性换成GetItems(Microsoft.SharePoint.SPView) 方法(The GetItems method of the SPList class returns a collection of list items from the list based on the specified view. )

具体我是这样用的objList.GetItems(objList. DefaultView),再次测试结果发现返回items集合只用了0.3秒左右的时间。

我就不明白了~都是同一家公司出的如此相似的两个操作性能差距砸就那大尼。

看来以后items属性千万不能用 ,直接cut掉得拉




相关文章

相关软件