ZooFlow: Add My.Helpers
This commit is contained in:
@@ -85,27 +85,4 @@ Module ModuleHelpers
|
||||
End Try
|
||||
Return connectionString
|
||||
End Function
|
||||
|
||||
Public Function FilterDatatable(pDatatable As DataTable, pFilterString As String, pCheckColumn As String, pSortString As String, pReturnDataTable As Boolean) As Object
|
||||
Try
|
||||
If pDatatable.Rows.Count = 0 Then
|
||||
Return Nothing
|
||||
End If
|
||||
Dim oDataView As DataView = pDatatable.DefaultView
|
||||
oDataView.RowFilter = pFilterString
|
||||
If oDataView.Count = 1 And pReturnDataTable = False Then
|
||||
Dim oView As DataRowView = oDataView.Item(0)
|
||||
Dim oRow As DataRow = oView.Row
|
||||
Return oRow.Item(pCheckColumn)
|
||||
Else
|
||||
Dim oDataTableCopy As DataTable = New DataTable()
|
||||
oDataTableCopy = pDatatable.Select(pFilterString, pSortString).CopyToDataTable()
|
||||
|
||||
Return oDataTableCopy
|
||||
End If
|
||||
Catch ex As Exception
|
||||
MsgBox("Unexpected Error in FilterDatatable: " + ex.Message, MsgBoxStyle.Critical)
|
||||
Return Nothing
|
||||
End Try
|
||||
End Function
|
||||
End Module
|
||||
|
||||
Reference in New Issue
Block a user