Anyone ever had this error? Tried to use an ObjectDataSource with a GridView in ASP.NET 2.0? Ever followed a tutorial and tweeked it slightly only to have it blow up in your face?
I'm not going to talk about how to wire up the GridView with the ObjectDataSource, there are already great tutorials explaining how to do that. I'm not even going to talk about how to create your business objects. What I want to focus on are the entity objects because that is where my problem was at. I spent forever on Google and couldn't find anyone talking about this. It turns out (now that I understand it correctly) that I was searching on the wrong thing. ARGH!!! Anyways...here is the gist of it, your entity objects cannot just have public members, they must have public properties (get/set).
Huh, that's weird. And why is that the case, you may ask? Because you can't databind to a variable. And why is that? I don't know, it just is. Go ask Scott Hanselman if you really want to know.
Be careful reading reading that last link, read the details and don't get caught up in the emotion of the KISS principal like the author tends to emphasize. That's what caused me this headache in the first place. 
Originally, my entity object looked like this..
And this was the error I got...
After I changed it to this everything worked.