C# IExcelDataReader-最后一期专栏文章
我正在使用Excel到数据集转换概念C#。为此,我使用IExcelDataReader 这是我的密码C# IExcelDataReader-最后一期专栏文章,c#,excel,c#-4.0,C#,Excel,C# 4.0,我正在使用Excel到数据集转换概念C#。为此,我使用IExcelDataReader 这是我的密码 string AttachmentPath = Server.MapPath(".") + @"\" + FileUpload1.FileName; FileUpload1.SaveAs(AttachmentPath); FileStream stream = File.Open(AttachmentPath, FileMode.Open, FileAccess.Read); I
string AttachmentPath = Server.MapPath(".") + @"\" + FileUpload1.FileName;
FileUpload1.SaveAs(AttachmentPath);
FileStream stream = File.Open(AttachmentPath, FileMode.Open, FileAccess.Read);
IExcelDataReader excelReader = ExcelReaderFactory.CreateBinaryReader(stream);
excelReader.IsFirstRowAsColumnNames = true;
DataSet result = excelReader.AsDataSet();
我的问题是,excel中的最后一列没有导出到数据集。例如,每当我在.xls中有5列时,转换到dataset后,我只得到4列。跳过了最后一列。除此之外,我没有使用任何代码。是否尝试另存为excel 2007?我以前听说过这个问题2003@Mr.Monshaw非常感谢……这很有道理。。。。