Browse by Tags

All Tags » LINQ (RSS)

Visual Studio 2008 SP1 Beta br0ke my LINQ-to-SQL

As indicated in my previous article , I recently reinstalled my PC... One of the "updates" I made was installing Visual Studio 2008 SP1 Beta! Well... As Murphy would have it... I needed to change some stuff on a older project I have been working on. I opened the project, and I needed to update some of my LINQ-2-SQL entities just to find I can't open LINQ or compile my application! Here is the error message I received: The custom tool 'MSLinqToSQLGenerator' failed.  Could...

WCF + LINQ?

In an n-tier application, is it possible to send objects created by LINQ between layers? More specifically, is it possible to send LINQ object via a WCF service? Well, the short answer is yes. I will first show you how to do it then I will try and discuss why I want to do it and try and list the pros and cons! I am only going to demo how to do this using the designer interface (LINQ to SQL - DBML) but it is also possible to use it in SQLMetal.exe! I opened an existing project, clicked on the design...
Posted by rudi | 3 comment(s)
Filed under: ,

LINQing a VS2005 Application

I have an already existing VS2005 application to which I want to add LINQ support. The following 2 changes enable LINQ: Edit the .csproj file and replace <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> with <Import Project="$(ProgramFiles)\LINQ Preview\Misc\Linq.targets" /> This enable Implicit Typed Local Variable using the VAR keyword, Anonymous Types and Extension Methods . Lambda Expressions and Collection initializers seems to work even if you...
Posted by rudi | with no comments
Filed under:

Bind LINQ and WPF

The following sample code shows how to bind a LINQ query to a WPF control only using C#. listBox1.ItemsSource = dataContext.Members; DataTemplate template = new DataTemplate(); FrameworkElementFactory factory = new FrameworkElementFactory(typeof(StackPanel)); template.VisualTree = factory; FrameworkElementFactory childFactory = new FrameworkElementFactory(typeof(Label)); childFactory.SetBinding(Label.ContentProperty, new Binding("Name")); factory.AppendChild(childFactory); childFactory...
Posted by rudi | with no comments
Filed under: ,

LINQ

Last night I attended a very informative talk hosted by sadeveloper.net. Armand explained in detail how LINQ works. Some very interesting subjects was touched on (ie. Lambda expressions, Anonymous types, Extension methods, etc.). The only subject that wasn't touched on was binding to WPF controls. I am hoping to post a little more on this subject in the near feature. I also lauched my first official open-source project today. Please note that the project is still in very early development but...
Posted by rudi | 2 comment(s)
Filed under: ,