Hi there.
I wonder if there was a "correct answer" for Vb.Net (I understand this is
quite easy in C#).
If im drawing data from a database using a TableAdapter the data ends up in
a DataTable. I then need to iterate through the DataTable to get the values
out. This in itself is not a big issue.
Code something like...
For x = 0 to........
myString = DataTable.Rows( x).Item("MyValu e")
until I come across a Null value.
A Null value in the Database throws an exception which is easy to address
with a Try Catch statement. However as mentioned in some of the excellent
articles this is not a good solution for the problem.
Is there some means of testing the value before accessing it so that the
Try/Catch would no longer be required.
Perhaps something like:
If Not Datatable.Rows( 0).Item("MyValu e") = Nothing Then
myString = DataTable.Rows( 0).Item("MyValu e")
End If
Which doesnt work!
Try/Catch just seems the wrong approach.
Regards
Martyn Fewtrell