看起來像其他人有這個問題,但我想知道如何使用下面的代碼列表列名稱中有空格時如何定位列。以下是我有: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