Quite often, when coding, I'll have to do something in .NET that I haven't done in two or three years. For example, today (yes on this gorgeous summer Sunday that is a holiday weekend, I am sitting here working boo hoo, but I do have some paddling plans for a little later today so it's okay...) I have to write out an xml file from a DataSet that contains two DataTables that are related to each other. I did just that - created the DataSet, created the DataRelation, did the WriteXML, looked at the output and the relation wasn't there. The elements of the two separate tables were siblings, rather than parent child. Scratch head. I know I did this in one of my first .NET apps in 2002. So frustrating! Oh yeah, something special I had to do. Something where I have to tell .NET to use that DataRelation when I write the XML but I just can't remember what! Hmmm. So I first look to see if Intellisense will show me. But I'm looking at the WriteXML (which I truly know only takes the destination and a flag about schema - but like an idiot, I look anyway.) Nope, no hints there. Then into the doc and search on DataRelation WriteXml. Ahh yes, Nested Relations. But still that is not enough. I have to go look at a darned code sample in the documentation to figure out how to do it. There's a part of me that feels like such a dope. I should know this stuff. It's so simple. I've done it before. But the logical part of me says, no, that's okay. You can't be expected to memorize EVERYTHING. That's why there is documentation. But still the nagging feeling of a little bit of shame is still there. I had to look this all up as if I had never done it before as if I was a .NET Newbie or something. It's a good time to for a re-read of this classic from Leon Bambrick entitled “You are not Inadequate“
(BTW - it's DataRelation.Nested = True)