Sample source code below will show you how to cope with a difficult task like import from list in C#. ByteScout Spreadsheet SDK is the SDK that can write and read, modify and calculate Excel and CSV spreadsheets. Most popular formulas are supported. You may import or export data to and from CSV, XML, JSON as well as to and from databases, arrays. It can be used to import from list using C#.
You will save a lot of time on writing and testing code as you may just take the C# code from ByteScout Spreadsheet SDK for import from list below and use it in your application. This C# sample code is all you need for your app. Just copy and paste the code, add references (if needs to) and you are all set! Enjoy writing a code with ready-to-use sample C# codes.
Our website provides trial version of ByteScout Spreadsheet SDK for free. It also includes documentation and source code samples.
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.Collections; using System.Diagnostics; using System.IO; namespace Bytescout.Spreadsheet.Demo.Csharp.ImportFromList { class Program { static void Main(string[] args) { const string fileName = "CSharpImportFromList.xls"; // Create a new spreadsheet Spreadsheet spreadsheet = new Spreadsheet(); // Get the data from the 2D array that we want to import IList planets = GetList(); // Import data into spreadheet spreadsheet.ImportFromList(planets); // Save the spreadsheet if (File.Exists(fileName)) File.Delete(fileName); spreadsheet.SaveAs(fileName); // Close spreadsheet spreadsheet.Close(); // Open the spreadsheet Process.Start(fileName); } /// <summary> /// Creates a list of planets /// </summary> /// <returns>List of planets</returns> private static IList GetList() { string[,] planets = new string[9,1]; planets[0,0] = "Mercury"; planets[1,0] = "Venus"; planets[2,0] = "Earth"; planets[3,0] = "Mars"; planets[4,0] = "Jupiter"; planets[5,0] = "Saturn"; planets[6,0] = "Uranus"; planets[7,0] = "Neptune"; planets[8,0] = "Pluto"; return planets; } } }
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: