Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

c# todatatable nullable

<Extension()>
Public Function HasNull(dataTable As DataTable) As Boolean
    If dataTable Is Nothing Then
        Throw New ArgumentNullException("dataTable must be initialized", "dataTable")
    End If
    Dim allColumns = dataTable.Columns.Cast(Of DataColumn).ToList() ' materialize
    Dim hasNullField As Boolean = dataTable.AsEnumerable().
        Any(Function(row) allColumns.Any(Function(c) row.IsNull(c)))
    Return hasNullField
End Function
Source by codereview.stackexchange.com #
 
PREVIOUS NEXT
Tagged: #todatatable #nullable
ADD COMMENT
Topic
Name
5+4 =