TheChaseMan's Frenetic SoapBox

Always looking for better ways to do things...

Got LINQ working! (Hello World edition)

I uninstalled VS2005 RC so I could play around with LINQ. As unbelievable as it sounds, I was able to uninstall the RC, install Beta 2, install the WinFX Beta 1 and SDK, and then install LINQ along with the Visual Studio templates. So here is my first lame app using LINQ...

using System;

using System.Collections.Generic;

using System.Text;

using System.Query;

using System.Xml.XLinq;

using System.Data.DLinq;

 

namespace LINQConsoleApplication1

{

    class Program

    {

        static void Main(string[] args)

        {

            string[] words = {"Hello", "Car", "Orange", "World", "Popcorn"};

 

            var helloLinq = from word in words

                            where word.Length == 5

                            select word;

 

            foreach(string s in helloLinq)

                Console.Write(s + " ");

        }

    }

}



OK, so that's pretty underwhelming, I know...I'll have more interesting posts after I get SQL 2005 running and create some DLINQ proof-of-concept code in a few days.
Digg!

posted on Sunday, September 18, 2005 9:08 PM

Feedback

# New LINQ Updates 5/14/2006 2:27 PM TheChaseMan's Frenetic SoapBox