Alex Dove

Alex Dove

  • NA
  • 3
  • 2.5k

SPDataSource to show GridView of BCS external list

Jan 14 2013 4:44 PM
I am using an SPDataSource and an ASP GridView to attempt to display a grid of external list data. While I have been successful targeting a normal SharePoint list, when I attempt to target an external list I run into problems. I am using SPDataSource to pull in a CAML query using the SelectCommand, but get errors such as:

1. File not found
2. List 'abc123' does not exist at site with URL 'http://abcdev'
3. Object not set to the instance of an object

Here is my code for SPDataSource:
<SharePoint:SPDataSource runat="server" ID="dsClient" DataSourceMode="List" UseInternalName="true" SelectCommand="<Webs Scope='Recursive'></Webs><Query><OrderBy><FieldRef Name='clientname' Ascending='true' /></OrderBy></Query>">
    <SelectParameters>
        <asp:Parameter Name="ListName" DefaultValue="GUID for external list" />
        <asp:Parameter Name="WebURL" DefaultValue="{rootsitecollection}" />
    </SelectParameters>
</SharePoint:SPDataSource>


The external list I am targeting is returned from the top-level web of the site collection "http://abcdev". So, what am I doing wrong that I cannot get the external list to display in my grid?

I believe the issue with my code falls on the SPDataSource Parameter ...
<asp:Parameter Name="WebURL" DefaultValue="{rootsitecollection}" />

but what am I doing wrong?

I have tried the following DefaultValues:
1. {rootsitecollection}
2. ""  -[leaving it blank]
3. /
4. http://abcdev
5. abcdev

Unfortunately, all return one of the errors posted above. Any suggestions on a fix?
Thank you so much in advance.


Answers (1)