using System; using System.Collections.Generic; using System.Linq; using System.Text; using Excel; using System.IO; using System.Data; namespace ConsoleApplication8 { class Program { static void Main(string[] args) { FileStream stream = File.Open(@"c:\users\afshandc\documents\visual studio 2012\Projects\ConsoleApplication8\ConsoleApplication8\Test Excel File.xlsx", FileMode.Open, FileAccess.Read); IExcelDataReader excelReader = ExcelReaderFactory.CreateOpenXmlReader(stream); DataSet result = excelReader.AsDataSet(); while (excelReader.Read()) { Console.WriteLine(excelReader[0].ToString()); } excelReader.Close(); Console.ReadLine(); } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)