I want to read the data from multiple rows and columns in excel using C#

Posted by Prashant6252 under DotNetFunda.Com on 2/5/2015 | Points: 10 | Views : 1567 | Status : [Member] | Replies : 1
Hi All,

I want to write a function, that reads values from multiple rows and columns from excel using C#. Assuming there is only one worksheet in the excel. In the later point of time, if i add any more sheets in the workbook, i can easily easily give reference to that sheet and access the data as well.

In attached excel, I want to check for the condition using state as parameter, If state matches with stat1, i want to read the values for that row Ex: If stat1 == stat1, then i want to read values as stat1, Office1, Und1, A1, City1 nd Count1 and store it in Variable.

Will be waiting for the reply.
Thanks in Advance !!


Posted by: Jitendrasoft09 on: 2/6/2015 [Member] [MVP] Starter | Points: 25


You can add excel library namespace "Microsoft.Office.Interop.Excel" in c# code and start working reading the multiple column from excel worksheet, please refer below link for more details, the link is not meet your requirement but you can go ahead further.


Jitendra Kumar
If my post helps you, plz mark as an answer.

Prashant6252, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response