Globi Integration und Suche Abhängig
This commit is contained in:
@@ -56,5 +56,26 @@ Module ModuleHelpers
|
||||
Public Sub Refresh_RegexTable()
|
||||
My.Application.BASE_DATA_DT_REGEX = My.Database.GetDatatable("SELECT * FROM TBGI_FUNCTION_REGEX")
|
||||
End Sub
|
||||
Public Function FilterDatatable(myDatatable As DataTable, myFilter As String, mycheckColumn As String, pSortString As String, returnDT As Boolean) As Object
|
||||
Try
|
||||
Dim dv As DataView = myDatatable.DefaultView
|
||||
dv.RowFilter = myFilter
|
||||
If dv.Count = 1 And returnDT = False Then
|
||||
For Each rowView As DataRowView In dv
|
||||
Dim row As DataRow = rowView.Row
|
||||
Return row.Item(mycheckColumn)
|
||||
Next
|
||||
Else
|
||||
Dim dt_copy As DataTable = New DataTable()
|
||||
dt_copy = myDatatable.Select(myFilter, pSortString).CopyToDataTable()
|
||||
|
||||
Return dt_copy
|
||||
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