Import data from Excel file

Hi everybody, is it possible with the Excel component to import this data (see link) into a dataset or database ? I really need to know, if so I’m gonna buy the component asap. :slight_smile:

http://users.pandora.be/techne/reynaers.xls



Thx a lot,

Walter

Hi Walter,

Please download the latest hotfix at

and have a try.

@thundercat,
Aspose.Excel is discontinued and is replaced with a highly efficient and feature-rich product Aspose.Cells. This new product supports the latest features of MS Excel as well as support for older versions. You can export data from worksheet with this new product as shown in the following sample code:

string filePath = dataDir + "Book1.xlsx";

// Instantiating a Workbook object
Workbook workbook = new Workbook(filePath);

// Accessing the first worksheet in the Excel file
Worksheet worksheet = workbook.Worksheets[0];

// Exporting the contents of 7 rows and 2 columns starting from 1st cell to DataTable
DataTable dataTable = worksheet.Cells.ExportDataTable(0, 0, 11, 2, true);

foreach (DataRow r in dataTable.Rows)
{
    foreach (DataColumn c in dataTable.Columns)
    {
        Double value = r.Field<Double>(c);
        Console.Write(value + "    ");
    }
    Console.WriteLine();
}

Following is a link to a detailed article about exporting data from worksheet:
Export Data from Worksheet

You can download the latest version of this product here:
Aspose.Cells for .NET (Latest Version)

Here is a runnable solution which can be used to test the features of this new product with minimal effort.