Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
OleDb connection to Excel - date converted to string
Message
De
11/07/2007 10:42:59
Mike Cole
Yellow Lab Technologies
Stanley, Iowa, États-Unis
 
 
À
11/07/2007 10:41:49
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
ASP.NET
Catégorie:
ADO.NET
Versions des environnements
Environment:
VB 8.0
OS:
Windows XP SP2
Network:
Windows 2003 Server
Divers
Thread ID:
01239233
Message ID:
01239270
Vues:
9
>>I have an application that reads a date (formatted as Date) from an Excel file using an OleDb connection into an untyped dataset. This has been working fine, but suddenly when the date I was trying to read became 7/13/2007, the value in my dataset turned to String type of "39275". When I change the data format type in Excel to string, it becomes "39275", so that is where that value came from. How can I fix this so it loads as a date instead of a string?
>
>Mike,
>Excel internally stores the date as a numeric value (days since 12/29/1899). Formatting a cell as date changes the display but not the underlying value.
>Cetin

Weird, I was in debug mode and seeing the "39275", and about 10 minutes later it turned back to "7/13/2007".
Very fitting: http://xkcd.com/386/
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform