How Read and Import Excel Sheet cell by cell and save into Database in ASP.Net

Last Reply on Nov 08, 2016 08:04 AM By dharmendr

Posted on Nov 08, 2016 07:55 AM

I have an requirement where user uploads an excel file in this process data from cell is extracted and then saved in database (excel file won't get saved in our application only data is extracted) our application when reads this file then it must read all cells one by one and while processing it should do three important task:

1- If special character is found in excel cell then that row must be ignored and after process is complete it should display that cell data in gridview.

2- There should be not more than four columns in excel file.

3- If complete row data is already found in database then system should ignore that row

While surfing I found few articles which might help you/me in finding the solution:


Posted on Nov 08, 2016 08:04 AM

Hi EmadKhan,

You can refer the below article.

Read and Import Excel Sheet into ASP.Net GridView Control

In the above article you are you are getting the datatable in the section "Read Data from First Sheet". Once you will get the data you can loop through each record and achive your task as per your condition.