I have a list in SharePoint 2010. If I add items to the list programmatically (via a custom webpart), I can later read those items and show them in other web parts. However, if I attempt to read a list item added through the web interface, I get the following error in my webpart:
Item does not exist. The page you selected contains an item that does not exist. It may have been deleted by another user.0x81020016
The weird part is, in the debugger, I see that the list item is properly read. I'm pulling what's left of my hair out over this one.
Any ideas?
Here's the answer for anyone who cares:
I was calling my page like this - mywebpage.aspx?id=1, where id=1 was the id of the item in the list I wanted my webpart to display. For some reason known only to Microsoft, using 'id' in the query string is a no-no. So I changed the param name to 'lid' and now everything works like I would expect.
Thanks for everyone's responses.