2011-02-10 29 views
5

मेरे पास एक SharePoint 2010 फार्म समाधान है जो एक सूची तैनात करता है, और उस सूची से पढ़ता है जो एक वेब हिस्सा है। यह वास्तव में उससे अधिक करता है, लेकिन मैं "सूची पढ़ें" भाग से पहले नहीं जा सकता।शेयरपॉइंट 2010 - सूची आइटम पढ़ने में त्रुटि "इस क्रिया को पूरा नहीं कर सकता। कृपया पुनः प्रयास करें।"

मैं सफलतापूर्वक सूची पूछता हूं और SPListItemCollection वापस प्राप्त करने में सक्षम हूं, लेकिन जब मैं वस्तुओं के माध्यम से लूप करने का प्रयास करता हूं तो मुझे यह पूरी तरह अस्पष्ट त्रुटि मिलती है "इस क्रिया को पूरा नहीं कर सकता। कृपया पुनः प्रयास करें।" पूर्ण स्टैक ट्रेस नीचे:

[COMException (0x80004005): Cannot complete this action. 

Please try again.<nativehr>0x80004005</nativehr><nativestack></nativestack>] 
    Microsoft.SharePoint.Library.SPRequestInternalClass.GetListItemDataWithCallback2(IListItemSqlClient pSqlClient, String bstrUrl, String bstrListName, String bstrViewName, String bstrViewXml, SAFEARRAYFLAGS fSafeArrayFlags, ISP2DSafeArrayWriter pSACallback, ISPDataCallback pPagingCallback, ISPDataCallback pPagingPrevCallback, ISPDataCallback pFilterLinkCallback, ISPDataCallback pSchemaCallback, ISPDataCallback pRowCountCallback, Boolean& pbMaximalView) +0 
    Microsoft.SharePoint.Library.SPRequest.GetListItemDataWithCallback2(IListItemSqlClient pSqlClient, String bstrUrl, String bstrListName, String bstrViewName, String bstrViewXml, SAFEARRAYFLAGS fSafeArrayFlags, ISP2DSafeArrayWriter pSACallback, ISPDataCallback pPagingCallback, ISPDataCallback pPagingPrevCallback, ISPDataCallback pFilterLinkCallback, ISPDataCallback pSchemaCallback, ISPDataCallback pRowCountCallback, Boolean& pbMaximalView) +256 

[SPException: Cannot complete this action. 

Please try again.] 
    Microsoft.SharePoint.SPGlobal.HandleComException(COMException comEx) +27257906 
    Microsoft.SharePoint.Library.SPRequest.GetListItemDataWithCallback2(IListItemSqlClient pSqlClient, String bstrUrl, String bstrListName, String bstrViewName, String bstrViewXml, SAFEARRAYFLAGS fSafeArrayFlags, ISP2DSafeArrayWriter pSACallback, ISPDataCallback pPagingCallback, ISPDataCallback pPagingPrevCallback, ISPDataCallback pFilterLinkCallback, ISPDataCallback pSchemaCallback, ISPDataCallback pRowCountCallback, Boolean& pbMaximalView) +27639062 
    Microsoft.SharePoint.SPListItemCollection.EnsureListItemsData() +4145 
    Microsoft.SharePoint.SPListItemCollection.GetEnumerator() +146 
    X.CBAS.TargetedNav.TargetedNav.TargetedNav.getUrlsForUser() +433 
    X.CBAS.TargetedNav.TargetedNav.TargetedNav.CreateChildControls() +437 
    System.Web.UI.Control.EnsureChildControls() +146 
    X.CBAS.TargetedNav.TargetedNav.TargetedNav.OnLoad(EventArgs e) +140 
    System.Web.UI.Control.LoadRecursive() +66 
    System.Web.UI.Control.LoadRecursive() +191 
    System.Web.UI.Control.LoadRecursive() +191 
    System.Web.UI.Control.LoadRecursive() +191 
    System.Web.UI.Control.LoadRecursive() +191 
    System.Web.UI.Control.LoadRecursive() +191 
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2428 

मैं सूची परिभाषा को कई बार देखा है और यह, ध्वनि लग रहा है के रूप में मैं क्या देख सकते हैं से वेब हिस्सा कोड है।

सूची परिभाषा:

<ContentTypes> 
    <ContentTypeRef ID="0x0105"> 
    <Folder TargetName="Link" /> 
    </ContentTypeRef> 
    <ContentTypeRef ID="0x0120" /> 
</ContentTypes> 
<Fields> 
    <Field ID="{fa564e0f-0c70-4ab9-b863-0177e6ddd247}" Name="Title" ReadOnly="TRUE" Required="FALSE" Hidden="TRUE" SourceID="http://schemas.microsoft.com/sharepoint/v3" StaticName="Title"></Field> 
    <Field ID="{82642ec8-ef9b-478f-acf9-31f7d45fbc31}" Name="LinkTitle" Hidden="TRUE" SourceID="http://schemas.microsoft.com/sharepoint/v3" StaticName="LinkTitle"></Field> 
    <Field ID="{bc91a437-52e7-49e1-8c4e-4698904b2b6d}" Name="LinkTitleNoMenu" Hidden="TRUE" SourceID="http://schemas.microsoft.com/sharepoint/v3" StaticName="LinkTitleNoMenu"></Field> 
    <Field ID="{081c6e4c-5c14-4f20-b23e-1a71ceb6a67c}" Name="DocIcon" DisplaceOnUpgrade="TRUE" DisplayName="$Resources:core,Type;" SourceID="http://schemas.microsoft.com/sharepoint/v3" StaticName="DocIcon"></Field> 
    <Field ID="{503f1caa-358e-4918-9094-4a2cdc4bc034}" Name="Edit" DisplayName="$Resources:core,Edit;" SourceID="http://schemas.microsoft.com/sharepoint/v3" StaticName="Edit"></Field> 
    <Field ID="{c29e077d-f466-4d8e-8bbe-72b66c5f205c}" Type="URL" Name="URL" DisplayName="$Resources:core,URL;" Required="TRUE" FromBaseType="TRUE" ShowInViewForms="FALSE" SourceID="http://schemas.microsoft.com/sharepoint/v3" StaticName="URL"></Field> 
    <Field ID="{9da97a8a-1da5-4a77-98d3-4bc10456e700}" Type="Note" Name="Comments" DisplayName="$Resources:core,Notes;" Sortable="FALSE" SourceID="http://schemas.microsoft.com/sharepoint/v3" StaticName="Comments"></Field> 
    <Field ID="{DEDA572B-9D15-4FCE-81DA-D12EE9C29D61}" Type="Text" Name="Source" DisplayName="$Resources:X.CBAS.TargetedNav,FieldSource;" StaticName="Source" /> 
    <Field ID="{D68FEB34-BC7B-450D-8422-AA4CBA74D517}" Type="Text" Name="EpiwManagerYN" DisplayName="$Resources:X.CBAS.TargetedNav,FieldEpiwManagerYN;" StaticName="EpiwManagerYN" /> 
    <Field ID="{2a9ab6d3-268a-4c1c-9897-e5f018f87e64}" ReadOnly="TRUE" Filterable="FALSE" Type="Computed" Name="URLwMenu" DisplayName="$Resources:core,URL;" DisplayNameSrcField="URL" ClassInfo="Menu" AuthoringInfo="$Resources:core,URLwEditMenu;" ListItemMenuAllowed="Required" LinkToItemAllowed="Prohibited" SourceID="http://schemas.microsoft.com/sharepoint/v3" StaticName="URLwMenu"> 
    <FieldRefs> 
     <FieldRef Name="URL" /> 
     <FieldRef Name="FileLeafRef" /> 
     <FieldRef Name="FileRef" /> 
     <FieldRef Name="FSObjType" /> 
     <FieldRef Name="_EditMenuTableStart2" /> 
     <FieldRef Name="_EditMenuTableEnd" /> 
    </FieldRefs> 
    </Field> 
    <Field ID="{7A7F3660-D408-4734-9AA0-2D86E33D79AB}" ReadOnly="TRUE" Filterable="FALSE" Type="Computed" Name="URLwMenu2" DisplayName="$Resources:core,URL;" DisplayNameSrcField="URL" ClassInfo="Menu" AuthoringInfo="$Resources:core,URLwEditMenu; (old)" SourceID="http://schemas.microsoft.com/sharepoint/v3" StaticName="URLwMenu2"> 
    <FieldRefs> 
     <FieldRef Name="URL" /> 
     <FieldRef Name="FileLeafRef" /> 
     <FieldRef Name="FileRef" /> 
     <FieldRef Name="FSObjType" /> 
     <FieldRef Name="_EditMenuTableStart" /> 
     <FieldRef Name="_EditMenuTableEnd" /> 
    </FieldRefs> 
    </Field> 
    <Field ID="{aeaf07ee-d2fb-448b-a7a3-cf7e062d6c2a}" DisplaceOnUpgrade="TRUE" ReadOnly="TRUE" Filterable="FALSE" Type="Computed" Name="URLNoMenu" DisplayName="$Resources:core,URL;" DisplayNameSrcField="URL" SourceID="http://schemas.microsoft.com/sharepoint/v3" StaticName="URLNoMenu"> 
    <FieldRefs> 
     <FieldRef Name="URL" /> 
     <FieldRef Name="FileLeafRef" /> 
     <FieldRef Name="FileRef" /> 
     <FieldRef Name="FSObjType" /> 
    </FieldRefs> 
    </Field> 
</Fields> 

नीचे कोड से पता चलता है, जहां मैं त्रुटि में चल रहा हूँ - फिर से, कुछ खास नहीं:

SPQuery query = new SPQuery() { Query = this.filterQuery }; 

//Loop through the returned URL(s) and add them to the list 
foreach (SPItem item in list.getItems(query)) { //<-- Error happens here, when getting the enumerator for the SPListItemsCollection 
     returnValue.Add(this.getUrlFromItem(item)); 
} 

और अंत में, CAML:

<Where> 
    <FieldRef Name="Source" /> 
    <Value Type="Text">http://dev01:80/Pages/default.aspx</Value> 
</Where> 

यहां क्या हो रहा है पर किसी भी विचार की सराहना की जाएगी!

उत्तर

12

मैंने इस मुद्दे की खोज की - खराब सीएएमएल वाक्यविन्यास।

बुरा CAML:

<Where> 
    <FieldRef Name="Source" /> 
    <Value Type="Text">http://dev01:80/Pages/default.aspx</Value> 
</Where> 

उचित CAML:

<Where> 
    <Eq> 
    <FieldRef Name="Source" /> 
    <Value Type="Text">http://dev01:80/Pages/default.aspx</Value> 
    </Eq> 
</Where> 

अजीब है, मैं कभी नहीं देखा है इस तरह एक त्रुटि में बुरा CAML वाक्य रचना परिणाम।

+3

यह वास्तव में काफी आम है, "इस क्रिया को पूरा नहीं कर सकता" = "सीएएमएल में त्रुटि", मेरे पास कुछ "मज़ा" है जो पिछले –

+0

में उत्तर देने के लिए धन्यवाद! मुझे एक ही समस्या में एक ही समस्या थी .. :) – Abbas

 संबंधित मुद्दे

  • कोई संबंधित समस्या नहीं^_^