In my if statement below I need to check if in the first tables first row/column contains a string but I get an exception if the table has no rows.
the exception is:
"System.IndexOutOfRangeException = {"There is no row at position 0."}"
Code snippet:
'if the table has no rows then an exception happens here
If myDataSet.Tables(0).Rows(0)(0).ToString <> "MyMessage" then
'do this - redirect
Else
myDataSet.Tables(0).Rows(0)(0) = "no message"
End If
Can you help please?