How to catch a zero net change in a DataSet before Adapter Update?

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



I'm relativley new to using DataSets with Adapters but I think I've gotten most of what I need working. However, I've tripped over a special case. That scenario is where I add a row to my DataSet but then I wind up marking that row for deletion before I get to the Update. I keep getting a System.InvalidOperationException and I'm not sure why. My DeleteCommand's parameters use the OriginalVersion of the row to find and delete rows. But any newly added rows marked for delete shouldn't have an Original version. This maybe the problem. I thought I could just use a foreach loop on the Rows and everything I found a row that was marked for delete but had no original version I could simply remove it but that too seems to cause an exception. Is there a correct way to handle this scenario?

Thanks,

Jason

.