Click here to Skip to main content
15,891,204 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi to all ..

I am a non-expert programmer type but I am developing Desktop Applications. I just wanna ask if is it possible to get the data of each cell in MS Excel using C# codes?
Posted

1 solution

Yes it is possible. Basically, you can treat the excel file like a database. Using OLE DB[^], you can manipulate the data in your excel file as if you were doing it against a database.

Now for the examples, see the following.

Read Excel File into DataSet in ASP.NET Using C#[^]
How to Read Microsoft Excel 2007 Using a Connection String in C#[^]
 
Share this answer
 
Comments
Romeland C. dela Peña 7-Jan-14 21:04pm    
aha thank you for that!! ..

here's the scenario:

i have an excel file which contains product info (ProductCode, ProductName, Qty and etc.). Now, i want to get the data of each row and each cell. My purpose of getting such data is to reflect or should i say automatically adjust (add or subtract) the remaining quantity of that product in my database based on the quantity that i got from the excel.

Excel file is just for recording the used products and that file will be uploaded to the system.
walterhevedeich 7-Jan-14 21:16pm    
You're welcome. That seems pretty straightforward, given that you already have some guide in doing it. Should you encounter some specific issues on your scenario, feel free to post another question.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900