Sample source code below will show you how to cope with a difficult task like export to 2d array in C#. Want to export to 2d array in your C# app? ByteScout Spreadsheet SDK is designed for it. ByteScout Spreadsheet SDK is the SDK component for writing, reading, modifying and calculating Excel and CSV spreadsheets. Can calculate and reculculate formulas with Excel installed. You may import or export data to and from CSV, XML, JSON. Supports export to databases, arrays, streams.
This code snippet below for ByteScout Spreadsheet SDK works best when you need to quickly export to 2d array in your C# application. Just copy and paste the code into your C# application’s code and follow the instruction. Code testing will allow the function to be tested and work properly with your data.
You can download free trial version of ByteScout Spreadsheet SDK from our website to see and try many others source code samples for C#.
On-demand (REST Web API) version:
Web API (on-demand version)
On-premise offline SDK for Windows:
60 Day Free Trial (on-premise)
using System; namespace Bytescout.Spreadsheet.Demo.Csharp.ExportTo2DArray { 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.ExportTo2DArray(); // Close spreadsheet spreadsheet.Close(); // Display data in data table for(int i = 0; i < stockPrices.GetLength(0); i++) { for(int j = 0; j < stockPrices.GetLength(1); j++) { Console.Write(stockPrices[i,j] + " "); } Console.WriteLine(); } // Pause Console.ReadLine(); } } }
60 Day Free Trial or Visit ByteScout Spreadsheet SDK Home Page
Explore ByteScout Spreadsheet SDK Documentation
Explore Samples
Sign Up for ByteScout Spreadsheet SDK Online Training
Get Your API Key
Explore Web API Docs
Explore Web API Samples
60 Day Free Trial or Visit ByteScout Spreadsheet SDK Home Page
Explore ByteScout Spreadsheet SDK Documentation
Explore Samples
Sign Up for ByteScout Spreadsheet SDK Online Training
Get Your API Key
Explore Web API Docs
Explore Web API Samples
also available as: