excel导入数据库 select * from [sheet1$]读入dataset 然后循环插入excel第一行为该excel文档的标题 ,重第二行开始才是内容,怎样才能只重第二行读起写入dataset?
解决方案 »
- 50分!!!! asp.net实现下载功能(急需)>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>___________
- sql语句为啥错
- HTML4.0和XHTML 1.0,哪个是趋势?
- 网页数据读取问题
- 关于ASP.NET中ViewState序列化的一个问题
- 一个简单的问题,可是不知道也没有办法!
- response怎么用?
- 如何用编程手段检查asp.net有没有在iis中注册?
- 问大家一个关于添加记录后如何取得标识字段值的问题
- gridview中gridview索引超出范围。必须为非负值并小于集合大小。 参数名: index,求帮助
- 帮忙看下存储过程的问题
- 滚动新闻,每一次滚动显示显示一条,谁有代码,谢谢
{
for (int j = 1; j <= 20; j++)//列
{
Range r = (Range)mySheet.Cells[i, j];
}
}
这条语句默认就是把第一行当作列名,第二行开始才是内容
c#, c++ \"
VB6, VBScript ""
xml (web.config etc) "
or maybe use a single quota '.
"HDR=Yes;" indicates that the first row contains columnnames, not data. "HDR=No;" indicates the opposite.
"IMEX=1;" tells the driver to always read "intermixed" (numbers, dates, strings etc) data columns as text. Note that this option might affect excel sheet write access negative.
楼上的强。
{
tab.Rows[i]["name"].ToString();}错误:name不属于datatable ?????
{
tab.Rows[i][0].ToString();
}
没必要 只从第2行读 这样效果一样
默认就从第二行读的如果想把Excel表里的第一行的数据也写入加个 HDR=No
string mystring = "Provider = Microsoft.Jet.OLEDB.4.0 ; Data Source = '" + fPath + "';Extended Properties='Excel 8.0;HDR=No;IMEX=1'";