Posted 7 December 2021, 11:39 am EST
- Updated 4 October 2022, 8:36 am EST
Hello Kartik,
first: many thanks for your support and your solution. Your example works fine and i understand how its working.
Today i try to implement it to my project and only one point is open.
How to hand over my datatable after an sql query to your observableCollection
----my vb Code
Imports System.Data
Imports System.Data.OleDb
Imports System.Collections.ObjectModel
Imports System.Globalization
Namespace NS_Störungsübersicht
Partial Public Class C1WPF_Störungsübersicht
Inherits Window
Public datas As ObservableCollection(Of Data) = New ObservableCollection(Of Data)()
----get the data from my database
Private Sub DB_Query()
Dim dt As New System.Data.DataTable
Try
connection.Open()
cmd = New OleDbCommand("Select edd.param01 as Zugehörig, edd.verweis as Nr, er.erfass_dat As Angelegt, rm.bez_lang As Störungskatalog, Substring(edd.dlg_data,11,490) As Meldung, Concat(p.person_vorname, ' ',p.person_name) as Melder, edd.param_str01 as Status, er.grund_19 as Stillstand, er.grund_20 as Bis FROM event_res er, event_dlg_data edd, personen p, res_massnahmen rm where er.artikel = (Select rb.res_nr from res_bestand rb where rb.bezeichnung='" + cmb_Ressource.Text + "') and edd.verweis=er.dlg_data_verweis and er.person_nr=p.karten_nummer and rm.res_familie = (Select rb.res_familie from res_bestand rb where rb.bezeichnung='" + cmb_Ressource.Text + "' and rm.massnahme = er.info_03 ) and edd.param_d01 = '1' ORDER BY erfass_dat DESC", connection)
dt.Load(cmd.ExecuteReader)
----and now i should hand over the data for the converter before my code goes ahead to fill the C1Datagrid
DG_Vorauswahl.ItemsSource = dt.AsDataView
connection.Close()
Hope I will find the solution cause the actual result looks like this:
Thanks again and I hope. I can post you the final result :-).
Best Regards,
Chris