DLINQ Gotchas

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:

  1. 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
  2. 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:

Sortable
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.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: