Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

While debugging, the site looks fine, it's just web that doesn't load okay. Can't figure out why. Throws generic exception when attempting to access a property: HRESULT: 0x80131904

Any thoughts?

Here is a snippet of code:

using (SPSite site = new SPSite("http://blah.blahblah.com/sites/site/en"))
{
    try
    {
        using (SPWeb web = site.OpenWeb())
        {
            SPList list = web.Lists.TryGetList("Events"); 
            if (list != null)
            {
                // do stuff with the list
            }
        }
    }
    catch (Exception ex)
    {
        System.Web.HttpContext.Current.Response.Write("Error getting list: " + ex.Message);
    }
}
share|improve this question

2 Answers 2

up vote 2 down vote accepted

I believe I figured out my own question. The web app that this block of code was being called from was different from the other web app it was trying to open. So i made them both run on the same app pool and it worked fine. Hope this helps someone in the future.

share|improve this answer

this is also generated by an invalid filter value. I got this when i was trying to setup a value for my filtered view and i was using "closed" as the value for my workflow status filter option where it should have been an integer value of something like "27". Crazy stupid method they used but here's the post where i resolved my issue:

http://social.msdn.microsoft.com/Forums/en-US/sharepointworkflow/thread/f5de7947-f49b-420a-b8d8-d44ad6b7769f

See this post on how to find the custom integer value for your custom workflow status value.

share|improve this answer

Your Answer

 
discard

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

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