Read excel file using C# and .NET
With C#, we can read excel file data and can store it into DataTable object easily. To do this, you may need to install and prepare development environment as well in the system wherever you want to deploy this application. This is one of the probable solution and is not limited to. Also, I have developed and tested this in Windows environment only, no idea about other OS. Development environment: OS Windows 7 32bit, VS 2012, Excel 2013. Prerequisites: 1. Download and install " Data Connectivity Components ". 2. Register msexcl40.dll located in C:\Windows\System32 3. Register oledb32.dll located in C:\Program Files\Common Files\System\Ole DB Create an excel file. Here, I have created with name Test.xlsx as shown in figure below. Lets move to C# code. To work with excel file, you need an OledbConnection object to communicate with the .xls/.xlsx file. OLEDB (Object Linking and Embedding, Database) is an API designed by Microsoft to access