Holy fuck, I just struggled for hours on a problem with datagridview - such a rudimentary problem too, but I am so tired today I didn't realize.
Quick summary so I don't try to sound too smart and fuck up my meaning, ran a foreach loop on datagridviewrows, basically doing some simple read and compare coding on a particular column for about 10,000 entries. For some reason I kept getting an 'object is not instantiated' error, and for the longest time I thought it was talking about my datagridview object in general - then I realized it probably meant the few entries that were null - I wasn't doing any exception handling for that (duh).
Anyhoo, that I figured out quickly, the next part should have been arguably easier to figure out, but I spent the rest of my day (mind you, a pretty lazy day) trying to figure it out - it kept giving me the error except it was slightly different, I noticed my program was doing -something- but still giving me the error. I couldn't figure it out until I finally realized that the last row in my datagridview was the 'new row' thinger. It kept hanging on that for some reason, even with my error handling.
I just switched to a for (i) loop and told it to count up to the second last entry, and all is well now. I just wish I didn't take so long (probably like 2 actual hours was spent on this) and I am positive there is a way around it with a foreach loop, I just have no idea what it would be, and I don't want to put in the effort figuring it out now.
I'm still new at programming guys
.
Quick summary so I don't try to sound too smart and fuck up my meaning, ran a foreach loop on datagridviewrows, basically doing some simple read and compare coding on a particular column for about 10,000 entries. For some reason I kept getting an 'object is not instantiated' error, and for the longest time I thought it was talking about my datagridview object in general - then I realized it probably meant the few entries that were null - I wasn't doing any exception handling for that (duh).
Anyhoo, that I figured out quickly, the next part should have been arguably easier to figure out, but I spent the rest of my day (mind you, a pretty lazy day) trying to figure it out - it kept giving me the error except it was slightly different, I noticed my program was doing -something- but still giving me the error. I couldn't figure it out until I finally realized that the last row in my datagridview was the 'new row' thinger. It kept hanging on that for some reason, even with my error handling.
I just switched to a for (i) loop and told it to count up to the second last entry, and all is well now. I just wish I didn't take so long (probably like 2 actual hours was spent on this) and I am positive there is a way around it with a foreach loop, I just have no idea what it would be, and I don't want to put in the effort figuring it out now.
I'm still new at programming guys