I have just written a new codeproject article about DLINQ using the May 2006 CTP and have stumbled on a few things, that may interest some folk.
Im aware (and have even downloaded the Virtual PC version of) Visual Studio “Orcas”, which now has May 2007 CTP LINQ stuff included. So these gotchas may no longer exist. But ill list them anyway
In my article I am dealing with a Winforms app, so am using a DataGridView to show the results of any queries. I only came across 2 things really:
I am obviously dealing with a Winforms app here, so am using a DataGridView to show the results of any queries. I only came across 2 things really:
- When trying to bind the results of a DLINQ query to the DataGridView I had to use the undocumented ToBindingList() on the end of a DLINQ query to be abe to set it as the datasource for the DataGridView
- Normally a DataGridView allows its bound contents to be sorted using a column click. Attempting this with DLINQ query bound to the DataGridView , causes an Exception “DataGridView control cannot be sorted if it is bound to an IBlindingList that does support sorting”
The 1st one is fair enough once you know about it.
The 2nd point, Mmmm thats bad. So I had a hunt about and found this article:
bindinglist and DLinq which kind of says that in the May 2006 LINQ CTP version of LINQ there is limited binding support, and its all going to get better in future. So I guess well just have to wait for Visual Studio Orcas to be released officially.