The Excel To Sql2008

fairy9999 2010-09-29 11:25:58
I hava a excel file ,the sheet1 format like this
A B C D E F G H I
1 02:00
2 16:00
3 h3
4 0.124
5 0.234

The E1 && E2 cells format is datetime ,but the E3,E4,E5 is string,
when i using oledb connector read this sheets to database ,the data format convert was error like this
a b c d e
02:00
16:00
NULL
1899/01/01 01:24
1899/01/01 02:34

the connectionstring is
Provider=Microsoft.ACE.OLEDB.12.0;Data Source=F:\XBoxProgram\MESD\DataFormat\CH350-40023 _16.00_H5-H6.xls;Extended Properties="EXCEL 12.0;HDR=NO;IMEX=1";
I hava IMEX=1,but i can't hava real data to database
How Can i get real data to database?
the excel files was Excel2007 sava as Excel97-2003
...全文
73 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
宝_爸 2010-09-29
  • 打赏
  • 举报
回复
What is your problem?

h3 is not DateTime so I think NULL is fine.

111,129

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Creator Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧