I'm using SharePoint 2013 and I'm developing a webpart that has to query an external data and show the results. I cannot create external list due to the fact that my external table has more than 200,000 records.

What I'm looking for is to query this data source without creating an external list using BCS.

Am I on the right way at all ?

How can I achieve this ?

2 Answers 2


See the Reference Implementation for External Data Models. It specifically has a section of writing web parts that query the BDC directly using the BDC Runtime API.

The relevant namespaces are


I'd like to give you more details but your question is a bit broad so hopefully this is enough to get you started in the right direction.

  • Robert, your participation is highly appreciated. Did you yourself did such a thing ? Reading all of these documentations are out of my time scope. I simply have a table out there and want to query that using BCS. Is there any sample projects or something ?
    – Pouyan
    Commented Feb 23, 2014 at 7:32
  • No, it just happens that a few hours before I read your question I was studying for the 489 exam and was reading those exact pages. It seemed like the example might be enough to get started. But I couldn't warn you about potential "gottchas", as we say. Commented Feb 23, 2014 at 15:33

You don't have to create an external list to use BCS, you can query External Content Types using code (even javascript), or the OOTB Business WebParts. But you have to make sure you don't return to many items. The default row limit is 2000 (SPBusinessDataCatalogThrottleConfig).

I can't see any issues using External Content Types, as long as your queries don't return to many items (guess that goes for other approaches to the problem too). There are a number of filters available using ECT. I have often connected the ECT to SQL Stored Procedures in the past on large lists for aggregation or returning a subset of items without out any issues.

  • Dear Anders, thanks for your time. I am aware of the fact that this is indeed possible to use BCS. What I don't know is HOW?... I saw no sample projects nor any codes to see HOW can I actually get some data by query using BCS API.
    – Pouyan
    Commented Feb 24, 2014 at 17:48
  • MSDN has examples, like this simple code snippet to get you started: msdn.microsoft.com/en-us/library/office/… and for CSOM you could download this project to get an idea on how that is done. code.msdn.microsoft.com/office/… Commented Feb 24, 2014 at 20:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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