Export To DataSet - VB.NET
Spreadsheet SDK sample in VB.NET demonstrating ‘Export To DataSet’
Module1.vb
Module Module1
Sub Main()
Dim inputFile As String = "PeriodicTableOfElementsSpreadsheet.xls"
'Open and load spreadsheet
Dim spreadsheet = New Spreadsheet()
spreadsheet.LoadFromFile(inputFile)
'Get the data from the spreadsheet
Dim ds As DataSet = spreadsheet.ExportToDataSet()
'Close spreadsheet
spreadsheet.Close()
'Display data in first datatable of dataset
Dim dt As DataTable = ds.Tables(0)
Console.WriteLine("Displaying contents of first datatable")
For i As Integer = 0 To dt.Rows.Count - 1
For j As Integer = 0 To dt.Columns.Count - 1
Console.Write(dt.Rows(i)(j) + " ")
Next
Console.WriteLine()
Next
'Pause
Console.ReadLine()
End Sub
End Module
Resources.Designer.vb
��' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
' <