jj__25_01_16

This commit is contained in:
JenneJ
2016-01-25 15:24:58 +01:00
parent c11f38f414
commit 60e54ef33b
4 changed files with 27 additions and 37 deletions

View File

@@ -19,8 +19,7 @@
Dim returnValue As DynamicValue
returnValue.StaticList = CheckForStaticList(controlId)
returnValue.DataTable = GetSqlList(controlId, formId, SQLCommand)
'returnValue.DataTable = CheckForSqlCommand(controlId, formId)
returnValue.DataTable = GetSqlList(controlId, formId, sqlCommand)
Return returnValue
End Function
@@ -49,16 +48,16 @@
Return Nothing
End If
'Dim cached As DataTable = ClassControlValueCache.LoadFromCache(formId, controlId)
Dim cached As DataTable = ClassControlValueCache.LoadFromCache(sqlCommand)
Dim final As DataTable
If cached Is Nothing Then
final = ClassDatabase.Return_Datatable(sqlCommand)
'ClassControlValueCache.SaveToCache(formId, controlId, final)
ClassControlValueCache.SaveToCache(sqlCommand, final)
Console.WriteLine("CACHE MISS")
Else
final = cached
Console.WriteLine("CACHE HIT")
End If
Return final
@@ -69,8 +68,11 @@
End Function
Overloads Shared Sub SetDataSource(control As Windows.Forms.ComboBox, dt As DataTable)
Dim sw As Stopwatch = Stopwatch.StartNew()
Dim columnCount As Integer = dt.Columns.Count
control.BeginUpdate()
' Damit beim Setzen von DisplayMember und ValueMember kein Fehler auftritt,
' muss die Datasource zunächst geleert werden und der selected index auf -1 gesetzt werden.
control.DataSource = Nothing
@@ -88,6 +90,11 @@
' Als letztes setzen wir die DataSource
control.DataSource = dt
control.EndUpdate()
sw.Stop()
Console.WriteLine("SetDataSource for {0} took {1}ms", control.Name, sw.ElapsedMilliseconds)
End Sub
Overloads Shared Sub SetDataSource(control As DevExpress.XtraEditors.CheckedListBoxControl, dt As DataTable)