Possible Duplicate:
C# extract formatted text from Excel through OLEDB
Can i somehow format an excel column and it's data as text, before fetching the data from it ? I'm using C# and .NET Framework 4.0
You can prefix the number by ' for example '100 will be shown as text.
Option 1
You can can try myCell.Style.NumberFormat = "@"
Here is an example online that should help give you an idea on how to use it:
- Example
Option 2
Alternatively you could try grabing myCell.Text
instead of myCell.Value
. Value is what is actually stored in the cell, whereas Text is what is displayed.
精彩评论