I have some code that goes
and when the dataset is empty and this line
DRDataTable = MyDataSet.Tables(0)
returns an error it does not get caught, why is this?
Code:
Dim DRDataTable As DataTable
Try
FunctionThatReturnsADataset(MyDataSet)
DRDataTable = MyDataSet.Tables(0)
' Processing ...
Catch ex As MyCustomException
End Try
Public Class MyCustomException
Inherits System.Exception
Public Sub New(ByVal Message As String)
MyBase.New()
End Sub
End Class
DRDataTable = MyDataSet.Tables(0)
returns an error it does not get caught, why is this?