Spire.XLS for .NET is a professional Excel .NET library that can be used to any type of .NET 2.0, 3.5, 4.0 or 4.5 framework application, both ASP.NET web sites and Windows Forms application.

Wed Nov 24, 2010 4:17 am

use this code read xls file to datatable has errors

Code: Select all
Spire.Xls.Workbook workbook = new Spire.Xls.Workbook();
            string ext = Path.GetExtension(FileName);
            if (ext == ".xls")
            {
                workbook.LoadFromFile(FileName, ExcelVersion.Version97to2003);
            }
            else if (ext == ".xlsx")
            {
                workbook.LoadFromFile(FileName, ExcelVersion.Version2007);

            }

            Spire.Xls.Worksheet sheet = workbook.Worksheets[0];
            DataTable excelData = sheet.ExportDataTable();
Attachments
xlsfile.rar
(971 Bytes) Downloaded 292 times

fugees
 
Posts: 5
Joined: Fri Oct 29, 2010 8:46 am

Wed Nov 24, 2010 11:14 am

fugees wrote:use this code read xls file to datatable has errors

Code: Select all
Spire.Xls.Workbook workbook = new Spire.Xls.Workbook();
            string ext = Path.GetExtension(FileName);
            if (ext == ".xls")
            {
                workbook.LoadFromFile(FileName, ExcelVersion.Version97to2003);
            }
            else if (ext == ".xlsx")
            {
                workbook.LoadFromFile(FileName, ExcelVersion.Version2007);

            }

            Spire.Xls.Worksheet sheet = workbook.Worksheets[0];
            DataTable excelData = sheet.ExportDataTable();


Sorry for that, it is a bug and we have fixed it.
We need more time to test it and will release it before the next Monday.
Harry
Technical Support / Developer,
e-iceblue Support Team
User avatar

harry.support
 
Posts: 180
Joined: Mon Nov 08, 2010 3:11 pm

Thu Dec 02, 2010 3:05 am

the new version of spire.xls had been released this Monday.
Harry
Technical Support / Developer,
e-iceblue Support Team
User avatar

harry.support
 
Posts: 180
Joined: Mon Nov 08, 2010 3:11 pm

Return to Spire.XLS