I started developing an application several weeks ago and decided today that I may want to use LINQ. So I changed my project from .NET Framework 2.0 to 3.5 and restarted the program.
However, I can not get the most basic LINQ statement to work. I thought it was my code until I started a blank .NET 3.5 project and inserted the basic code (below) which worked without issue. So I then started another .NET 2.0 project and inserted the code (which I knew wouldn't work) and the errors are the same as the project that I converted. So next I converted this new .NET 2.0 to 3.5 and the code still doesn't work. So migrating from 2.0 to 3.5 isn't working for LINQ.
My question is: If one changes from a .NET 2.0 to a .NET 3.5 how do they get LINQ to work properly?
Thanks in advace for your suggestions.
Code:' Data source. Dim numbers() As Integer = {0, 1, 2, 3, 4, 5, 6} ' Query creation. Dim evensQuery = From num In numbers Where num Mod 2 = 0 Select num ' Query execution. For Each number In evensQuery Console.Write(number & " ") ListBox1.Items.Add(number) Next





Reply With Quote