SQL Server Anpassungen, Reports repariert
This commit is contained in:
@@ -250,6 +250,7 @@ Public Class frmAuswertung
|
||||
Dim vpasql As New VERAG_PROG_ALLGEMEIN.SQL
|
||||
|
||||
dt = vpasql.loadDgvBySql(sql, database)
|
||||
'dt = RemoveDuplicateRows(dt, "atr_frachtpos")
|
||||
|
||||
printauswertung.von = von
|
||||
printauswertung.bis = bis
|
||||
@@ -270,4 +271,24 @@ Public Class frmAuswertung
|
||||
Return filialnr
|
||||
|
||||
End Function
|
||||
|
||||
Public Function RemoveDuplicateRows(ByVal dTable As DataTable, ByVal colName As String) As DataTable
|
||||
Dim hTable As Hashtable = New Hashtable()
|
||||
Dim duplicateList As ArrayList = New ArrayList()
|
||||
|
||||
For Each drow As DataRow In dTable.Rows
|
||||
|
||||
If hTable.Contains(drow(colName)) Then
|
||||
duplicateList.Add(drow)
|
||||
Else
|
||||
hTable.Add(drow(colName), String.Empty)
|
||||
End If
|
||||
Next
|
||||
|
||||
For Each dRow As DataRow In duplicateList
|
||||
dTable.Rows.Remove(dRow)
|
||||
Next
|
||||
|
||||
Return dTable
|
||||
End Function
|
||||
End Class
|
||||
Reference in New Issue
Block a user