开发者

Determine progress while evaluating LINQ query

My C# program has long executed LINQ query running against MS SQL Server database. I开发者_StackOverflow中文版'd like to show user a progress while executing the query. Is there any way to understand LINQ execution progress? Of course I can show undeterminate progress, but if possible, I'd prefer determinate.


It's not really about the LINQ query, but rather that of the underlying provider. As SQL Server doesn't have any notion of progress for any given query, LINQ cannot either. Regardless, even if the underlying datasource had some notion of progress, the LINQ framework does not have hooks to relay this to the caller. So, the answer is no, unfortunately.


There is no way to do that using LINQtoSQL. LINQtoSQL simply translates your LINQ query to a SQL query and sends it to the database. Then you simply wait until the database returns with results. There is no way to get any progress for that.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜