title: Read Excel using LINQ
body: <p>I want to read excel 2003( cannot change as its coming from third party) and group data in List or Dictionary (<strong>I don't which one is good</strong>) 
  for example below (Excel formatting )
  Books Data [first row and first column  in excel]
  second row( no records)
  Code,Name,IBN [third row (second column, third column]
  Aust     [fourth row, first column]
   UX         test1 34 [ fifth row (second column, third column]
  ......
  ....</p>
  
  <p>Books Data   </p>
  
  <pre><code>     Code     Name     IBN
  </code></pre>
  
  <p>Aust</p>
  
  <pre><code>    UX         test1     34
     UZ         test2     345
     UN         test3     5654
  </code></pre>
  
  <p>US</p>
  
  <pre><code>   UX         name1     567
    TG         nam2      123
    UM         name3     234
  </code></pre>
  
  <p>I am reading excel data using following code( some help from Google)</p>
  
  <pre><code>        string filename = @"C:\\" + "Book1.xls";
          string connectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" +
                                        "Data Source=" + filename + ";" +
                                        "Extended Properties=Excel 8.0;";
  
          OleDbDataAdapter dataAdapter = new OleDbDataAdapter("SELECT * FROM [Sheet1$]", connectionString);
          DataSet myDataSet = new DataSet();
          dataAdapter.Fill(myDataSet, "BookInfo");
          DataTable dataTable = myDataSet.Tables["BookInfo"];
  
  
         var rows = from p in dataTable.AsEnumerable()
         where p[0].ToString() != null || p[0].ToString() != "" &amp;&amp; p.Field&lt;string&gt;("F2") != null
         select new 
         { countryName= p[0],
             bookCode= p.Field&lt;string&gt;("F2"),
             bookName= p.Field&lt;string&gt;("F3")
        };
  </code></pre>
  
  <p>The code above is not good as to get the “Code” I am using “ F2” and for country I am using p[0].What should I use to get the code and name for each country.</p>
  
  <p>Also it’s give the information I want but I don't how to put in list or dictionary or in class so I can get data by passing parameter as a country name.</p>
  
  <p>In short first it must put all data in list or dictionary and then you can call list or dictionary get data filter by country.
  Thanks</p>