I know about this post on BCS paging: Paging and sorting with BCS and have implemented a similar approach in a BCS solution. However, what I'm really looking for is a complete example showing how to use the batching and batching termination filter descriptors in a BCS .NET Connectivity solution. The MSDN post: http://msdn.microsoft.com/en-us/library/ee557835.aspx is incomplete. If anyone knows of a source (blog, article, book, chm, post-it note) that demonstrates exactly how to use these batching filter descriptors, please let me know where to find it.



You can try this:

<Method Name="GetItems" LobName="GetItems" IsStatic="false">
            <FilterDescriptor Name="BatchingStateCookie" Type="Batching">
                <Property Name="BatchingCookie" Type="System.String">Cookie</Property>
            <FilterDescriptor Name="HasMoreBatches" Type="BatchingTermination">
                <Property Name="CaseSensitive" Type="System.Boolean">false</Property>
                <Property Name="Comparator" Type="System.String">!=</Property>
                <Property Name="TerminationValue" Type="System.String">true</Property>
            <Parameter Name="cookie" Direction="InOut">
              <TypeDescriptor Name="cookieTypeDescriptor" TypeName="System.String" AssociatedFilter="BatchingStateCookie"/>
            <Parameter Name="hasmore" Direction="Out">
              <TypeDescriptor Name="hasmoreTypeDescriptor" TypeName="System.String" AssociatedFilter="HasMoreBatches"/>

and in .NET:

int batch_size = 1000;
public MyItem[] GetItems(ref string cookie, out string hasmore)

    if (cookie == null) {
        // we are in first batch
        // do some initialization if needed
    MyItem[] items = new MyItem[batch_size];
    hasmore =  GetItemsFromDatabase(cookie, items) > 0 ? "true" : "false";
    cookie = items[0].Id; // or something else you need to determine what to bring in the next batch
    return items;
  • Have you gotten this to work in BCS .NET Connectivity solution? I tried this code and the entity was no longer available when creating an external list. Inspecting the log revealed the following error message (Level: Medium - go figure!) "VLPROV: Finder 'ReadList' has a filter of type 'Batching'. These filters are not supported for external lists. Creating no view for this finder. ... ValidateDefaultFindSpecificWithFinderExistence failed for entity: Entity1" – Tom Nov 16 '11 at 10:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.