Wednesday, February 04, 2009

SharePoint Sucks - How do I debug this?

This is some dummy code that I'm testing:

SPSite site = new SPSite("http://site/");

        SPWeb web = site.RootWeb;

        SPList list = web.Lists["Project Management Documents"];

        SPView view = list.Views["View Reports"];

        SPQuery query = new SPQuery(view);
        query.Query = @"
                        
                          
                        ";

        query.RowLimit = 5;

        spLit.Text = list.RenderAsHtml(query);
So I execute the code. I get a null reference error at the bottom.

I'm like, that's odd. If any of those were actually null, then I should have gotten an error. Anyways, let's see:

list - exists
query - exists
spLit - exists

Fuck you SharePoint.

No comments: