Fun Flubs -- Take 36478
In search of a Discovery of the Day, I again must describe a Stupidity o.t.d. experience. At least I am a mature-enough developer to first ask the question: What am I doing wrong? No one will learn much from this post, but can at least empathize with being momentarily stuck and finding humor in the problem once discovered.
I inherited a project (the long naming style ain't mine) and had to fix a bug in one of its data layer components. I kept receiving the familiar (well, not that familiar) "There is no row at position 0" error. The problem should be immediately obvious to most dotnetweblogs readers. (DataAdapter sqlAdapter1 was created earlier in method, so the dataset was being populated from another sqlStatement.)


I would step through the code repeatedly, and every line would happily step through. Yet the "no row at position 0" error persisted. Had I written the code from scratch rather than copy-paste from surrounding lines within the same method, I would have quickly seen that I was using a data adapter created earlier with a different sqlStatement than the one I had intended.

Moral of the story: We developers do awesome things with code, yet can encounter momentary lapses writing basic processes. I for one would rather be responsible for understanding these basic processes and occasionally finding humor in doing something stupid than to use a code generator approach and not have a sound understanding in .net coding principles.