Add Overload for ItemEx

This commit is contained in:
Jonathan Jenne 2022-07-04 12:03:43 +02:00
parent 65ee19790b
commit aaa1d04c87

View File

@ -10,6 +10,15 @@ Public Module DataTableEx
End Try
End Function
<Extension()>
Public Function ItemEx(Of T)(pRow As DataRow, pFieldIndex As Integer, Optional pDefaultValue As T = Nothing) As T
Try
Return Utils.NotNull(pRow.Item(pFieldIndex), pDefaultValue)
Catch ex As Exception
Return Nothing
End Try
End Function
<Extension()>
Public Function First(pTable As DataTable) As DataRow
Try