RayT
asked on
Linq to XML Using Visual Basic
How do I use Linq to get a list of countries that start with the letter 'B'?
Here's the data:
<?xml version="1.0" standalone="yes"?>
<NewDataSet>
<xs:schema id="NewDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas- microsoft- com:xml-ms data">
<xs:element name="NewDataSet" msdata:IsDataSet="true" msdata:UseCurrentLocale="t rue">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="Table1">
<xs:complexType>
<xs:sequence>
<xs:element name="ID" type="xs:int" minOccurs="0" />
<xs:element name="CountryName" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="255" />
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>
<Table1>
<ID>1</ID>
<CountryName>Afghanistan</ CountryNam e>
</Table1>
<Table1>
<ID>2</ID>
<CountryName>Albania</Coun tryName>
</Table1>
<Table1>
<ID>3</ID>
<CountryName>Algeria</Coun tryName>
</Table1>
<Table1>
<ID>4</ID>
<CountryName>Andorra</Coun tryName>
</Table1>
<Table1>
<ID>5</ID>
<CountryName>Angola</Count ryName>
</Table1>
<Table1>
<ID>6</ID>
<CountryName>Antigua and Barbuda</CountryName>
</Table1>
<Table1>
<ID>7</ID>
<CountryName>Argentina</Co untryName>
</Table1>
<Table1>
<ID>8</ID>
<CountryName>Armenia</Coun tryName>
</Table1>
<Table1>
<ID>9</ID>
<CountryName>Australia</Co untryName>
</Table1>
<Table1>
<ID>10</ID>
<CountryName>Austria</Coun tryName>
</Table1>
<Table1>
<ID>11</ID>
<CountryName>Azerbaijan</C ountryName >
</Table1>
<Table1>
<ID>12</ID>
<CountryName>Bahrain</Coun tryName>
</Table1>
<Table1>
<ID>13</ID>
<CountryName>Bangladesh</C ountryName >
</Table1>
<Table1>
<ID>14</ID>
<CountryName>Barbados</Cou ntryName>
</Table1>
<Table1>
<ID>15</ID>
<CountryName>Belarus</Coun tryName>
</Table1>
<Table1>
<ID>16</ID>
<CountryName>Belgium</Coun tryName>
</Table1>
<Table1>
<ID>17</ID>
<CountryName>Belize</Count ryName>
</Table1>
<Table1>
<ID>18</ID>
<CountryName>Benin</Countr yName>
</Table1>
<Table1>
<ID>19</ID>
<CountryName>Bhutan</Count ryName>
</Table1>
<Table1>
<ID>20</ID>
<CountryName>Bolivia</Coun tryName>
</Table1>
<Table1>
<ID>21</ID>
<CountryName>Bosnia and Herzegovina</CountryName>
</Table1>
<Table1>
<ID>22</ID>
<CountryName>Botswana</Cou ntryName>
</Table1>
<Table1>
<ID>23</ID>
<CountryName>Brazil</Count ryName>
</Table1>
<Table1>
<ID>24</ID>
<CountryName>Brunei</Count ryName>
</Table1>
<Table1>
<ID>25</ID>
<CountryName>Bulgaria</Cou ntryName>
</Table1>
<Table1>
<ID>26</ID>
<CountryName>Burkina Faso</CountryName>
</Table1>
<Table1>
<ID>27</ID>
<CountryName>Burundi</Coun tryName>
</Table1>
<Table1>
<ID>28</ID>
<CountryName>Cambodia</Cou ntryName>
</Table1>
<Table1>
<ID>29</ID>
<CountryName>Cameroon</Cou ntryName>
</Table1>
<Table1>
<ID>30</ID>
<CountryName>Canada</Count ryName>
</Table1>
</NewDataSet>
Here's the data:
<?xml version="1.0" standalone="yes"?>
<NewDataSet>
<xs:schema id="NewDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-
<xs:element name="NewDataSet" msdata:IsDataSet="true" msdata:UseCurrentLocale="t
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="Table1">
<xs:complexType>
<xs:sequence>
<xs:element name="ID" type="xs:int" minOccurs="0" />
<xs:element name="CountryName" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="255" />
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>
<Table1>
<ID>1</ID>
<CountryName>Afghanistan</
</Table1>
<Table1>
<ID>2</ID>
<CountryName>Albania</Coun
</Table1>
<Table1>
<ID>3</ID>
<CountryName>Algeria</Coun
</Table1>
<Table1>
<ID>4</ID>
<CountryName>Andorra</Coun
</Table1>
<Table1>
<ID>5</ID>
<CountryName>Angola</Count
</Table1>
<Table1>
<ID>6</ID>
<CountryName>Antigua and Barbuda</CountryName>
</Table1>
<Table1>
<ID>7</ID>
<CountryName>Argentina</Co
</Table1>
<Table1>
<ID>8</ID>
<CountryName>Armenia</Coun
</Table1>
<Table1>
<ID>9</ID>
<CountryName>Australia</Co
</Table1>
<Table1>
<ID>10</ID>
<CountryName>Austria</Coun
</Table1>
<Table1>
<ID>11</ID>
<CountryName>Azerbaijan</C
</Table1>
<Table1>
<ID>12</ID>
<CountryName>Bahrain</Coun
</Table1>
<Table1>
<ID>13</ID>
<CountryName>Bangladesh</C
</Table1>
<Table1>
<ID>14</ID>
<CountryName>Barbados</Cou
</Table1>
<Table1>
<ID>15</ID>
<CountryName>Belarus</Coun
</Table1>
<Table1>
<ID>16</ID>
<CountryName>Belgium</Coun
</Table1>
<Table1>
<ID>17</ID>
<CountryName>Belize</Count
</Table1>
<Table1>
<ID>18</ID>
<CountryName>Benin</Countr
</Table1>
<Table1>
<ID>19</ID>
<CountryName>Bhutan</Count
</Table1>
<Table1>
<ID>20</ID>
<CountryName>Bolivia</Coun
</Table1>
<Table1>
<ID>21</ID>
<CountryName>Bosnia and Herzegovina</CountryName>
</Table1>
<Table1>
<ID>22</ID>
<CountryName>Botswana</Cou
</Table1>
<Table1>
<ID>23</ID>
<CountryName>Brazil</Count
</Table1>
<Table1>
<ID>24</ID>
<CountryName>Brunei</Count
</Table1>
<Table1>
<ID>25</ID>
<CountryName>Bulgaria</Cou
</Table1>
<Table1>
<ID>26</ID>
<CountryName>Burkina Faso</CountryName>
</Table1>
<Table1>
<ID>27</ID>
<CountryName>Burundi</Coun
</Table1>
<Table1>
<ID>28</ID>
<CountryName>Cambodia</Cou
</Table1>
<Table1>
<ID>29</ID>
<CountryName>Cameroon</Cou
</Table1>
<Table1>
<ID>30</ID>
<CountryName>Canada</Count
</Table1>
</NewDataSet>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks!!!
ASKER
Expression of type 'System.Collections.Generi