I was wondering what the correct way to catch an exception for an empty “select” on a data table is. For example, if we have two variables: unfilteredDT and filteredDT. I want to apply a set of filter criteria to unfilteredDT and then assign that to filteredDT, which I know how to do, but if there are no data rows matching that criteria, an error is thrown because there are no data rows to assign.
I tried using an if statement to test the select prior to assigning so that I can skip that step but that also throws an error (I’m assuming because of the CopyToDataTable piece):
unfilteredDT.Select("[Status]=‘Open’ AND [Description]=‘Research Client Check Copy’").CopyToDataTable.Rows.Count = 0
Assign to filteredDT and do other stuff.
Hopefully that makes sense the way I’m trying to lay it out. I get work item data in my unfilteredDT from scraping but I need a way to test that there are items meeting my criteria before I assign it in any way or it throws an error which retries the transaction according to my retries config setting.