Open Xml: Simple/Entire Excel Parser application code to import large excel to any data source

Introduction:

In this article, I have provided the real time code which is used in one of my project to read the data from the excel and put that data into the sql server database (you can put into any database).

Here in this parser I have written the logic as per my requirement, so you can little bit tweak the logic to fit for your logic mainly by just changing the column no and header format

Attachement : openxml_attachment

Code:

Button_Click event code:

 

 

Methods to convert Workbook to datasource

 

Below are the four Methods to get value  based on column reference:

 

 

 

 

 

 

 

 

 

Methods to check whether  worksheet has required header format:

 

Common/Important  method to get cell value:

 

 

Method to get a string type value:

 

Hope it was helpful ,kindly find the source code in attachment andopenxml_attachment let me know your thoughts or feedback

 

Thanks

karthik

 

390 total views, 4 views today

2 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *