Tell me more ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.
  1. Business Case: The user needs to access the data outside of SharePoint 2010. The database is in MS SQL. The connection to MS SQL from SharePoint is done via configuring BDS and SSS impersonation model. The Data is retrieved in External Lists and then need accessed to Sandboxed Solution. The Solution is developed using Hybrid Execution with External Content Types and Reference Implementation: External Lists
  2. Version: SharePoint Enterprise 2010
  3. Solution Type: SandBoxed Solution
  4. Database and SharePoint resides on different Server
  5. Whenever I access the External Lists from Sites Pages then it works perfectly including user rights configured for it. But whenever I access the list from the Sandboxed solution, I get an error "The shim execution failed unexpectedly - Access is denied.."
  6. Accordingly to some blogs and articles on the web I also have checked with External Content Type Metadata Store Permissions and Object Permissions, but no luck
  7. The user is configured in Managed Account and Service Account
  8. Using SharePoint object model is last option, when it's impossible with other way.

Here I have questions related to the development:

  • Can we access the data from External Lists in SharePoint Sandboxed Solution without Client Object Model?
  • What can be reason for the error: "The shim execution failed unexpectedly - Access is denied.."
  • Does it have to do with NTLM and Kerberos authentication? I have checked with both but no success.
  • The error occurs in this code block checked in two ways:

    [SharePointPermission(SecurityAction.InheritanceDemand, ObjectModel = true)]
    [SharePointPermission(SecurityAction.LinkDemand, ObjectModel = true)]
    public DataTable GetAllVendors()
    {
        var web = SPContext.Current.Web;
        var dt = web.Lists["ectVendorListName"].Items.GetDataTable(); // Error occurs here.
        return dt;
    }
    
    [SharePointPermission(SecurityAction.InheritanceDemand, ObjectModel = true)]
    [SharePointPermission(SecurityAction.LinkDemand, ObjectModel = true)]
    public DataTable GetTableData(int _Id)
    {
        DataTable dt = new DataTable();
        using (SPWeb web = SPContext.Current.Web)
        {
            var query = new SPQuery
            {
                ViewFields =
                "<FieldRef Name='col1'/>" +
                "<FieldRef Name='col2'/>" +
                "<FieldRef Name='col3'/>" +
                "<FieldRef Name='col4'/>",
                Query = string.Format("<Where><Eq><FieldRef Name='col1' /><Value Type='Integer'>{0}</Value></Eq></Where>", _Id.ToString())
            };
            dt = web.Lists["List_Demo"].GetItems(query).GetDataTable(); // Error occurs here.
        }
        return dt;
    }
    
  • Any tips or knowledge sharing would be great help

share|improve this question

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.