0

I use EF6 with MvvmLight and Wpf (.NET 4.7.2) and SQL Server.

On my forms I have some comboboxes. They data bind to lists where list have about 200.000X4 data.

When I fill it, it take for me about 18 seconds (where SQL select takes about 7 seconds). I have 3 or more, so my window open nearby 2 minutes. I think its slow. I would like to solve this problem.

My combos need searching property so I not choose LinkedList. I thinking use a dynamically change List or what, about 100-1000 items of data.

How should I start or where could I searching?

An other half question is why generate ToList from EF IQueryable<T> is too slow, what should do instead of that? Combobox use VirtualizingStackPanel, so after I loading millions of items of data into the list, with this no problem.

But if anyway faster, I wouldn't like store all of the data in AlkLista (as combobox itemssource)

Thanks every helps.

Steve


ctx is my EF context, I binding AlkLista to combobox now

  AlkLista = new List<AlkCikkNev>(ctx.Alkatrészek             
                    .OrderBy(t => t.Alkatrész_AZ)   
                    .Select(t => new AlkCikkNev
                    {
                        AlkAz = t.Alkatrész_AZ,
                        Cikkszam = t.Cikkszám,
                        Nev = t.Név,
                        Rajzszam = t.Rajzszám
                    }).OrderBy(t => t.Cikkszam)
marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
iolah2
  • 13
  • 3
  • Possible duplicate, see this https://stackoverflow.com/questions/8198645/wpf-combobox-performance-problems-by-binding-a-large-collections – Ishraq Ahmad Aug 26 '19 at 12:19
  • No, my question is not for VirtualizationStackPanel, I already use it. It is that how should I create my list or collection in back faster. So my problem is not combobox work slowly. This problem the data that I would like to connect combobox huge so slowly to create. I thinking on use Take(100) or Take(1000), but these need I refresh data when sy write characters to combobox that is not in the current part List. – iolah2 Aug 26 '19 at 20:18

0 Answers0