Free Support Forum -

Excel to SQL import

I need a method to import multiple “named ranges” into a SQL 2000 table in c#. How can Aspose help?

- DEilenberg

Please try the attached fix. You can use the following sample code:

Ranges[] ranges = excel.Worksheets.GetNamedRanges();

for(int i = 0; i < ranges.Length; i ++)
Range range = rangesIdea;

DataTable dt = range.ExportDataTable();

//Or you can use ExportDataTableAsString method if there are more than one data type in a column
//DataTable dt = range.ExportDataTableAsString();

//Populate data in the data table to your SQL server