Sharepoint列表名称和文档库名称之间的冲突

时间:2014-04-16 08:41:27

标签: c# sharepoint-2010

我的共享点网站我有一个名为“人员列表”的列表和一个名为“人物”的维基页面库。我创建了一个可视webpart来显示People列表中的数据。我创建了webpart属性来读取listname。我的visual webpart的webpart属性名称是“People”。当我使用以下函数检查我的网站中是否存在列表时,它返回true: -

 public static bool isListExists(SPWeb spWeb, string listName)
        {
            return spWeb.Lists.TryGetList(listName) != null;
        }

但我的网站中没有名为“People”的List。仅存在名为“People”的Wiki页面库。当我在“MySite / People / default.aspx”页面中添加我的webpart时出现错误。

Column 'Title' does not exist. It may have been deleted by another user.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.ArgumentException: Column 'Title' does not exist. It may have been deleted by another user.
Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


Stack Trace: 


[ArgumentException: Column 'Title' does not exist. It may have been deleted by another user.]
   Microsoft.SharePoint.SPFieldCollection.GetField(String strName, Boolean bThrowException) +26422968
   Microsoft.SharePoint.SPListItem.GetValue(String strName, Boolean bThrowException) +47
   Microsoft.SharePoint.SPListItem.get_Item(String fieldName) +12
   CL.DanceStudio.Portal.CLDance_Instructor.<>c__DisplayClass3.<Select>b__1() +1155
   Microsoft.SharePoint.<>c__DisplayClass4.<RunWithElevatedPrivileges>b__2() +729
   Microsoft.SharePoint.Utilities.SecurityContext.RunAsProcess(CodeToRunElevated secureCode) +27491206
   Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges(WaitCallback secureCode, Object param) +27194345
   Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges(CodeToRunElevated secureCode) +93
   CL.DanceStudio.Portal.CLDance_Instructor.CLDance_InstructorUserControl.Select() +291
   CL.DanceStudio.Portal.CLDance_Instructor.CLDance_InstructorUserControl.Page_Load(Object sender, EventArgs e) +52
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +25
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +42
   System.Web.UI.Control.OnLoad(EventArgs e) +132
   System.Web.UI.Control.LoadRecursive() +66
   System.Web.UI.Control.AddedControl(Control control, Int32 index) +350
   CL.DanceStudio.Portal.CLDance_Instructor.CLDance_Instructor.CreateChildControls() +194
   System.Web.UI.Control.EnsureChildControls() +146
   System.Web.UI.Control.PreRenderRecursiveInternal() +61
   System.Web.UI.Control.PreRenderRecursiveInternal() +224
   System.Web.UI.Control.PreRenderRecursiveInternal() +224
   System.Web.UI.Control.PreRenderRecursiveInternal() +224
   System.Web.UI.Control.PreRenderRecursiveInternal() +224
   System.Web.UI.Control.PreRenderRecursiveInternal() +224
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3394

我认为这是由于名称冲突造成的。请给我一个解决方案。

0 个答案:

没有答案