Hi all,
i want to count how many times a specific value inside a column of datatable appear, and i use this:
CountA = finalDT.Select("[Column 6] = ‘SOSPENSION’ ").CopyToDataTable.Rows.count
My problem is: when i haven’t values for SOSPENSION inside column 6, it go in error with “the source contains no Datarows” but in that case i want to put value 0 in my variable CounA, how can i do that?
My goal is to write into an excel spreadsheet how many times a particular value in the column 6 appear in my datatable.
And i use this expression CountA = finalDT.Select("[Column 6] = ‘SOSPENSION’ ").CopyToDataTable.Rows.count and it work!
The only problem is when the number of SOSPENSION in Column 6 is = 0, because it expect a value > 0