easy_ReadXLSSheet_AsDataSet method for XLS file easy_ReadXLSBSheet_AsDataSet method for XLSB file easy_ReadXLSXSheet_AsDataSet method for XLSX file For reading data from an Excel sheet and the name of the sheet is known, EasyXLS recommends the use of: If this is your case or if you are reading data from another active sheet use: Usually the first sheet is the active sheet inside an Excel file. There are three approaches for reading data from an Excel file with multiple sheets. The above code sample shows how to achieve this goal. easy_ReadXLSActiveSheet_AsDataSet method for XLS file easy_ReadXLSBActiveSheet_AsDataSet method for XLSB file easy_ReadXLSXActiveSheet_AsDataSet method for XLSX file The Excel data can be read with one single line of code using: Reading data from Excel file, if the Excel file has only one sheet, is the easiest approach. " the value is '" & dataTable.Rows(row).ItemArray(column) & "'") ' Display DataSet values Dim dataTable As DataTable = ds.Tables(0)įor row As Integer = 0 To - 1įor column As Integer = 0 To - 1Ĭonsole.WriteLine( "At row " & (row + 1) & ", column " & (column + 1) & _ ' Read Excel file to DataSet Dim ds As DataSet = workbook.easy_ReadXLSXActiveSheet_AsDataSet( "C:\Samples\Excel file.xlsx") ' Create an instance of the class that reads Excel files Dim workbook As New ExcelDocument
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |