看起来像其他人有这个问题,但我想知道如何使用下面的代码列表列名称中有空格时如何定位列。以下是我有:Sharepoint +的值不在预期的范围内+ SPListItem
SPWeb oWebsite = SPContext.Current.Web;
SPList oList = oWebsite.Lists["Project Info"];
SPListItemCollection collItem = oList.GetItems("Project Description");
if (collItem.Count > 0)
{
foreach (SPListItem oItem in collItem)
{
description = oItem["Project Description"].ToString();
}
}
如果我创建列表域“项目简介”用下划线的列名(Project_Description),那么它工作得很好,但上面的代码我得到一个错误:值不在预期的范围内
看起来像显示内容与列的内部名称。有人可以帮我弄这个吗?谢谢。
感谢您的。 – Josh 2010-07-30 16:27:38