ByteScout Spreadsheet SDK – C# – Export To List

  • Home
  • /
  • Articles
  • /
  • ByteScout Spreadsheet SDK – C# – Export To List

ByteScout Spreadsheet SDK – C# – Export To List

Program.cs

using System;
using System.Collections;

namespace Bytescout.Spreadsheet.Demo.Csharp.ExportToList
{
class Program
{
static void Main(string[] args)
{
const string inputFile = @”ListOfPlanetsSpreadsheet.xls”;

// Open and load spreadsheet
Spreadsheet spreadsheet = new Spreadsheet();
spreadsheet.LoadFromFile(inputFile);

// Get the data from the spreadsheet
IList planets = new string[10, 10];
spreadsheet.ExportToList(planets);

// Close spreadsheet
spreadsheet.Close();

// Display array
string[,] planetsArray = planets as string[,];
for (int i = 0; i < planetsArray.GetLength(0); i++) { for (int j = 0; j < planetsArray.GetLength(1); j++) { Console.Write(planetsArray[i, j] + " "); } Console.WriteLine(); } // Pause Console.ReadLine(); } } } [/csharp]


  Click here to get your Free Trial version of the SDK

prev
next