This example will help you in exporting data from XLS spreadsheet to jagged array in C# and Visual Basic .NET using Bytescout Spreadsheet SDK.
C#
using System; namespace Bytescout.Spreadsheet.Demo.Csharp.ExportToJaggedArray { class Program { static void Main(string[] args) { const string inputFile = @"StockPricesSpreadsheet.xls"; // Open and load spreadsheet Spreadsheet spreadsheet = new Spreadsheet(); spreadsheet.LoadFromFile(inputFile); // Get the data from the spreadsheet string[][] stockPrices = spreadsheet.ExportToJaggedArray(); // Close spreadsheet spreadsheet.Close(); // Display data in jagged array for (int i = 0; i < stockPrices.GetLength(0); i++) { Console.Write(stockPrices[i][0] + " "); Console.Write(stockPrices[i][1] + " "); Console.WriteLine(); } // Pause Console.ReadLine(); } } } [/vb] <p><strong>VB.NET</strong></p> [vb]Module Module1 Sub Main() Dim inputFile As String = "StockPricesSpreadsheet.xls" 'Open and load spreadsheet Dim spreadsheet = New Spreadsheet() spreadsheet.LoadFromFile(inputFile) 'Get the data from the spreadsheet Dim stockPrices()() As String = spreadsheet.ExportToJaggedArray() 'Close spreadsheet spreadsheet.Close() 'Display data in jagged array For i As Integer = 0 To stockPrices.GetLength(0) - 1 Console.Write(stockPrices(i)(0) + " ") Console.Write(stockPrices(i)(1) + " ") Console.WriteLine() Next 'Pause Console.ReadLine() End Sub End Module