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

IsNothingOrEmpty

Return if a datatable is nothing or if is empty.

Source

<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

Example

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: 5074