ASP.NET import Excel samples show how to import data from Excel file to dataset in ASP.NET. Use C# or Visual Basic source code below to import from Excel in ASP.NET with Bytescout Spreadsheet SDK.


 const string inputFile = @"PeriodicTableOfElementsSpreadsheet.xls";

           // Open and load excel spreadsheet
           Spreadsheet spreadsheet = new Spreadsheet();

           // Read the data from the excel spreadsheet into dataset structure 
           DataSet dataSet = spreadsheet.ExportToDataSet();

           // Close the excel spreadsheet object as no need anymore

           // Display data in the first data table in the dataset
           DataTable dt = dataSet.Tables[0];
           // Now this datatable contains data imported from excel file and we 
           // may work with this datatable for further data processing


Dim inputFile As String = "PeriodicTableOfElementsSpreadsheet.xls"

       'Open and load excel spreadsheet
       Dim spreadsheet = New Spreadsheet()

       ' retrieve the data from the excel spreadsheet and import into aspnet datatable object
       Dim dt As DataTable = spreadsheet.ExportToDataTable()

       'Close the spreadsheet object 

       ' now we may work with this data (imported from excel spreadsheet) stored in "dt" object