Display the employee names and their new hourly rate.
Imports System
Imports System.Xml.Linq
Public Class MainClass
Public Shared Sub Main()
Dim employees As XElement = XElement.Load("Employees.xml")
Dim afterQuery = From ele In employees.<Employee> Select Name = ele.<Name>.Value, Wage = CDbl(ele.<HourlyRate>.Value)
For Each ele In afterQuery
Console.WriteLine("{0} gets paid ${1} an hour.", ele.Name, ele.Wage.ToString("##.##"))
Next
End Sub
End Class
Related examples in the same category