There exists a single table (25 posts int, text and datetime) about millions of of recrds, and we have to extract them from the SQL Lite database after which render to some wpf xamDataGrid, What's the quickest method of doing the work in C#?

PLUS, what will be the most effective method of doing the work?

Options we've considered:

  • Obtaining a DataSet

  • Listing of Organizations

  • DataReader

  • Variety of CSVs

Thanks ahead of time.

You are able to load the information utilizing a background thread and populate the ObservableCollection while using Primary thread's Dispatcher, the priority being ContextIdle.

Dispatcher UIDispatcher = Dispatcher.CurrentDispatcher;
BackgroundWorker bw = new BackgroundWorker();
bw.DoWork += (sender,e) =>
    // Use a linq query to yield an IQueryable/IEnumerable List of data from DB
    foreach(Data data in DataList)   // Enumerated here
        UIDispatcher.Invoke(DispatcherPriority.ContextIdle, new Action(() => 

DataReader is often the quickest approach to connect with a sql database. read them in and parse them by hand to your own custom object collection.

Entity Framework provides you with the very best development experience around the application side and also the best degree of modeling abstraction, but in a performance hit. Organizations bind very nicely and simply to WPF UI elements.

A DataSet is simple to setup and can pressure the relational database abstraction to your application code in an exceedingly ugly way. It'll pressure you to definitely reference posts as strings inside a non type safe method in which will break limited to run time, and it is generally flimsy and never suggested any longer for just about any significant projects. (before DataSet fans jump lower my throat, this really is official guidance from MSFT

Variety of CSVs might be fast but harder to utilize and implement.

I'd say if you want top performance opt for DataReader, but when you'll need developer productivity opt for Entity Framework.