ExtensionMethod.NET Home of 846 C#, Visual Basic, F# and Javascript extension methods


Return if a datatable is nothing or if is empty.


<Extension()> _
Public Function IsNothingOrEmpty(ByRef dt As DataTable) As Boolean
    Dim result As Boolean = (dt Is Nothing)
    If Not result Then result = dt.Rows.Count = 0
    Return result
End Function


Dim dt As DataTable = ...
If Not dt.IsNothingOrEmpty Then
End If

Author: Luis Costa

Submitted on: 14 dec 2011

Language: VB

Type: System.Data.DataTable

Views: 4137