Above are the 2 images my automation basically is extracting multiple different types of dataTable from a company’s portal and just i need to check the 1st row is null or not and need to check if any of the column contains “-” only hyphen then it should throw exception.
Use For each row in datatable and follow the below Process
For Each Row in DataTable
If String.IsNullOrEmpty(Row(0).ToString)
Throw New Exception("First row is null or empty")
End If
For Each item in Row.ItemArray
If item.ToString.Trim = "-"
Throw New Exception("Column contains only a hyphen (-)")
End If
Next
Next