Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Linq C# to VB conversion select new...

Posted on 2009-02-09
1
Medium Priority
?
902 Views
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:
http://aspnet.4guysfromrolla.com/articles/042308-1.aspx

Thanks!

0
Comment
Question by:Starr Duskk
1 Comment
 
LVL 64

Accepted Solution

by:
Fernando Soto earned 2000 total points
ID: 23595294
Hi BobCSD;

This will do it.

Fernando





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

0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
Hello there! As a developer I have modified and refactored the unit tests which was written by fellow developers in the past. On the course, I have gone through various misconceptions and technical challenges when it comes to implementation. I would…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Kernel Data Recovery is a renowned Data Recovery solution provider which offers wide range of softwares for both enterprise and home users with its cost-effective solutions. Let's have a quick overview of the journey and data recovery tools range he…
Suggested Courses

581 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