title: open xml reading from excel file
body: <p>I want to implement openXml sdk 2.5 into my project. I do everything in this <a href="http://msdn.microsoft.com/en-us/library/office/gg575571.aspx">link</a></p>
  
  <pre><code>using DocumentFormat.OpenXml;
  using DocumentFormat.OpenXml.Packaging;
  using DocumentFormat.OpenXml.Spreadsheet;
  using System.IO.Packaging;
  
  
  static void Main(string[] args)
          {
  
              String fileName = @"C:\OPENXML\BigData.xlsx";
              // Comment one of the following lines to test the method separately.
              ReadExcelFileDOM(fileName);    // DOM
              //ReadExcelFileSAX(fileName);    // SAX
          }
  
          // The DOM approach.
          // Note that the code below works only for cells that contain numeric values.
          // 
          static void ReadExcelFileDOM(string fileName)
          {
              using (SpreadsheetDocument spreadsheetDocument = SpreadsheetDocument.Open(fileName, false))
              {
                  WorkbookPart workbookPart = spreadsheetDocument.WorkbookPart;
                  WorksheetPart worksheetPart = workbookPart.WorksheetParts.First();
                  SheetData sheetData = worksheetPart.Worksheet.Elements&lt;SheetData&gt;().First();
                  string text;
  
                  int rowCount= sheetData.Elements&lt;Row&gt;().Count();
  
                  foreach (Row r in sheetData.Elements&lt;Row&gt;())
                  {
                      foreach (Cell c in r.Elements&lt;Cell&gt;())
                      {
                          text = c.CellValue.Text;
                          Console.Write(text + " ");
                      }
                  }
                  Console.WriteLine();
                  Console.ReadKey();
              }
          }
  </code></pre>
  
  <p>But i am not getting any row. It hasn't entered loop. Note: I also set up openXml sdk 2.5 my computer</p>
  
  <p>And I find below code this is work for numeric value.For string value it writes 0 1 2 ... </p>
  
  <pre><code> private static void Main(string[] args)
              {
                  var filePath = @"C:/OPENXML/BigData.xlsx";
                  using (var document = SpreadsheetDocument.Open(filePath, false))
                  {
                      var workbookPart = document.WorkbookPart;
                      var workbook = workbookPart.Workbook;
  
                      var sheets = workbook.Descendants&lt;Sheet&gt;();
                      foreach (var sheet in sheets)
                      {
                          var worksheetPart = (WorksheetPart)workbookPart.GetPartById(sheet.Id);
                          var sharedStringPart = workbookPart.SharedStringTablePart;
                          //var values = sharedStringPart.SharedStringTable.Elements&lt;SharedStringItem&gt;().ToArray();
  
                          string text;
                          var rows = worksheetPart.Worksheet.Descendants&lt;Row&gt;();
                          foreach (var row in rows)
                          {
                              Console.WriteLine();
                              int count = row.Elements&lt;Cell&gt;().Count();
  
                              foreach (Cell c in row.Elements&lt;Cell&gt;())
                              {
  
                                  text = c.CellValue.InnerText;
  
                                  Console.Write(text + " ");
  
                              }
                          }
                      }
                  }
  
                  Console.ReadLine();
              }
  </code></pre>