ByteScout Spreadsheet SDK - C# - Export To DataTable - ByteScout

ByteScout Spreadsheet SDK – C# – Export To DataTable

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

How to export to datatable in C# with ByteScout Spreadsheet SDK

How to export to datatable in C#

With this source code sample you may quickly learn how to export to datatable in C#. ByteScout Spreadsheet SDK: 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. It can export to datatable in C#.

This code snippet below for ByteScout Spreadsheet SDK works best when you need to quickly export to datatable in your C# application. In your C# project or application you may simply copy & paste the code and then run your app! Test C# sample code examples whether they respond your needs and requirements for the project.

Trial version of ByteScout Spreadsheet SDK can be downloaded for free from our website. It also includes source code samples for C# and other programming languages.

On-demand (REST Web API) version:
 Web API (on-demand version)

On-premise offline SDK for Windows:
 60 Day Free Trial (on-premise)

Program.cs
      
using System; using System.Data; namespace Bytescout.Spreadsheet.Demo.Csharp.ExportToDataTable { class Program { static void Main(string[] args) { const string inputFile = @"PeriodicTableOfElementsSpreadsheet.xls"; // Open and load spreadsheet Spreadsheet spreadsheet = new Spreadsheet(); spreadsheet.LoadFromFile(inputFile); // Get the data from the spreadsheet DataTable dt = spreadsheet.ExportToDataTable(); // Close spreadsheet spreadsheet.Close(); // Display array for (int i = 0; i < dt.Rows.Count; i++) { for (int j = 0; j < dt.Columns.Count; j++) { Console.Write(dt.Rows[i][j] + " "); } Console.WriteLine(); } // Pause Console.ReadLine(); } } }

ON-PREMISE OFFLINE SDK

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

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

VIDEO

ON-PREMISE OFFLINE SDK

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

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

Tutorials:

prev
next