title: Open xml sdk read Number and datetime/number values
body: <p>I am using Open XML SDK 2.0 to read excel file. The file contains the info like below.</p>
  
  <p>Number         DataFound      Summary </p>
  
  <p>10           2012-12-12     abslsoddsdls</p>
  
  <p>20           2012-11-12     sllsdislkdrr</p>
  
  <p>When  I use Open XML SDK to get data from the file I get the cell DataType as String(sharedstring) always.. I need to get the datatype as it was in the excel file. Have a look at my code below. Any ideas how can i get the datatype of the cell as it was in the excel file?</p>
  
  <pre><code> SpreadsheetDocument spreadSheetDocument = SpreadsheetDocument.Open(dataStream, false);
              WorkbookPart workbookPart = spreadSheetDocument.WorkbookPart;
              IEnumerable&lt;Sheet&gt; sheets = spreadSheetDocument.WorkbookPart.Workbook.GetFirstChild&lt;Sheets&gt;().Elements&lt;Sheet&gt;();
              string relationshipId = sheets.First().Id.Value;
              WorksheetPart worksheetPart = (WorksheetPart)spreadSheetDocument.WorkbookPart.GetPartById(relationshipId);
              Worksheet workSheet = worksheetPart.Worksheet;
              SheetData sheetData = workSheet.GetFirstChild&lt;SheetData&gt;();
              IEnumerable&lt;Row&gt; rows = sheetData.Descendants&lt;Row&gt;();
              foreach (Cell cell in rows.ElementAt(0))
              {
                  dt.Columns.Add(GetCellValue(spreadSheetDocument, cell));
              }
  
              foreach (Row row in rows) //this will also include your header row...
              {
                  DataRow tempRow = dt.NewRow();
  
                  for (int i = 0; i &lt; row.Descendants&lt;Cell&gt;().Count(); i++)
                  {
                      tempRow[i] = GetCellValue(spreadSheetDocument, row.Descendants&lt;Cell&gt;().ElementAt(i ));
                  }
  
                  dt.Rows.Add(tempRow);
              }
              dt.Rows.RemoveAt(0);
  
  
  
  public static string GetCellValue(SpreadsheetDocument document, Cell cell)
          {
    SharedStringTablePart stringTablePart = document.WorkbookPart.SharedStringTablePart;
              string value = cell.CellValue.InnerXml;
  
              if (cell.DataType != null &amp;&amp; cell.DataType.Value == CellValues.SharedString) //cell.DataType is always SharedString!
              {
                  return stringTablePart.SharedStringTable.ChildElements[Int32.Parse(value)].InnerText;
              }
              else
              {
                  return value;
              }
          }
  </code></pre>