title: Accessing Excel Spreadsheet with C# occasionally returns blank value for some cells
body: <p>I need to access an excel spreadsheet and insert the data from the spreadsheet into a SQL Database. However the Primary Keys are mixed, most are numeric and some are alpha-numeric.</p>
  
  <p>The problem I have is that when the numeric and alpha-numeric Keys are in the same spreadsheet the alpha-numeric cells return blank values, whereas all the other cells return their data without problems.</p>
  
  <p>I am using the OleDb method to access the Excel file. After retrieving the data with a Command string I put the data into a DataAdapter and then I fill a DataSet. I iterate through all the rows (dr) in the first DataTable in the DataSet.</p>
  
  <p>I reference the columns by using, dr["..."].ToString()</p>
  
  <p>If I debug the project in Visual Studio 2008 and I view the "extended properties", by holding my mouse over the "dr" I can view the values of the DataRow, but the Primary Key that should be alpha-numeric is {}. The other values are enclosed in quotes, but the blank value has braces.</p>
  
  <p>Is this a C# problem or an Excel problem?</p>
  
  <p>Has anyone ever encountered this problem before, or maybe found a workaround/fix?</p>
  
  <p>Thanks in advance.</p>