Using a SQLiteProgressCallbackHander with Linq

Discussion of open issues, suggestions and bugs regarding LinqConnect – Devart's LINQ to SQL compatible ORM
Post Reply
HadleyHope
Posts: 8
Joined: Thu 24 Jan 2013 14:44

Using a SQLiteProgressCallbackHander with Linq

Post by HadleyHope » Tue 19 Feb 2013 17:18

Really like working with linqConnect so far, but I have a couple of long running queries, is it possible to display a progress bar?

I note that the SQLiteConnection class has a RegisterProgressHandler method, but I am at the moment just using the data context created from the database via the Entity Developer passing in a connection string.


Thanks Martin

MariiaI
Devart Team
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Re: Using a SQLiteProgressCallbackHander with Linq

Post by MariiaI » Thu 21 Feb 2013 13:37

You could try doing this in the next way - after creating a DataContext object, get its connection, cast it to SQLiteConnection and then use RegisterProgressHandler/UnRegisterProgressHandler methods. For example:

Code: Select all

 MainContext.MainDataContext dt = new MainContext.MainDataContext();           
 SQLiteConnection conn = (SQLiteConnection) dt.Connection;
 conn.Open();
 conn.RegisterProgressHandler(handler);
 ....
 conn.UnRegisterProgressHandler();
Please tell us if this helps.

Post Reply