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.

Try ByteScout Spreadsheet SDK today: Get 60 Day Free Trial or sign up for Web API

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(); } } }

Try ByteScout Spreadsheet SDK today: 60 Day Free Trial (on-premise version) or sign up for Web API (on demand version)

VIDEO

ON-PREMISE VERSION

Get 60 Day Free Trial or Visit ByteScout Spreadsheet SDK page

Explore ByteScout Spreadsheet SDK documentation

WEB API

Sign Up for free Web API key

Explore Web API Documentation

Tutorials:

prev
next