Clean up, add DataRow Extension

This commit is contained in:
Jonathan Jenne
2021-11-19 14:23:17 +01:00
parent cc81a77f05
commit dec45ef493
7 changed files with 72 additions and 80 deletions

View File

@@ -0,0 +1,13 @@
Imports System.Runtime.CompilerServices
Imports DigitalData.Modules.Language
Public Module DataRowEx
<Extension()>
Public Function ItemEx(Of T)(pRow As DataRow, pFieldName As String, Optional pDefaultValue As T = Nothing) As T
Try
Return Utils.NotNull(pRow.Item(pFieldName), pDefaultValue)
Catch ex As Exception
Return Nothing
End Try
End Function
End Module