Click here to Skip to main content
15,899,549 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have the data from the user on an excel sheet. I need to use that data in the logic. So is it possible to call an excel data in while running the code ?
Posted
Comments
Sergey Alexandrovich Kryukov 12-Jan-16 0:00am    
There is no such concept, "call data". What exactly do you want to achieve? What's the problem?
Of course you can read data from an Excel file, if this is what you mean.
—SA
Member 12247039 12-Jan-16 0:08am    
@Sergey...There is a cost matrix (2D array) in excel sheet. That is the input from the user. I want to use that matrix and start my logic. After the first iteration, I want to modify the excel sheet data and store it in a different excel sheet. For further iterations, I want to use the modified excel sheet and keep modifying the same till my problem ends.
Sergey Alexandrovich Kryukov 12-Jan-16 0:25am    
One way is ADO.NET with ACE (see the comment below), another one would be Microsoft Open XML Format SDK. And so on...
—SA
PIEBALDconsult 12-Jan-16 0:03am    
Yes, there are many ways to access data in an Excel file from C# and most other languages.
I prefer to use the ADO.net classes and the ACE engine.
deepankarbhatnagar 12-Jan-16 0:11am    
Data can export from excel to any databound control in asp.net

If you are just talking about 'using Excel data' from c#, you have a number of options

1) export the data from excel as csv/tsv to a file and read that file in c# : easy

2) use Excel Interop from C# : Way more complex - see this for a start (but you'll need to do a lot more research' likely) http://www.dotnetperls.com/excel[^]

3) I believe you can use ADO.NET to read data from an Excel spreadsheet - you'll need to Google for 'how to set it up'

4) There may be 3rd party solutions free or not that can read Excel Spreadsheets

obviously the choice on 1,2,3,4 depends on many things, none of which we can ascertain on the information you've provided
 
Share this answer
 
Comments
CPallini 12-Jan-16 4:10am    
5.
 
Share this answer
 

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