Linq C# to VB conversion select new...

Posted on 2009-02-09
Last Modified: 2013-11-11
I want to convert this Linq from C# to VB:

        var query = from employeeElement in parentElement.Descendants("Employee")
                    select new
                        Name = employeeElement.Attribute("name").Value,
                        Telephone = employeeElement.Attribute("telephone").Value

If important, this is from 4guysfrom rolla's download:


Question by:BobCSD
    1 Comment
    LVL 62

    Accepted Solution

    Hi BobCSD;

    This will do it.


    Dim query = From employeeElement In parentElement.Descendants("Employee") _
                Select New With { _
                                  .Name = employeeElement.Attribute("name").Value, _
                                  .Telephone = employeeElement.Attribute("telephone").Value _

    Open in new window


    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    Join & Write a Comment

    Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
    More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now