Click here to Skip to main content
15,878,852 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi everyone, I need to fetch data from excel, like 5 items into list box, how can I do with single item able to pass.?

  • JEERA
  • PISTA
  • BADAM
  • Sugar
  • etc....


What I have tried:

C#
Recipe.SelectIngredienttype(ExcelUtils.ReadData(1, "Item"));

i have tried to pass like this but i got only one value, need to pass 5
Posted
Updated 16-Jul-20 22:20pm
v3
Comments
Maciej Los 19-Jun-20 2:06am    
ExcelUtils is non-standard class. How would we know what parameter you have to pass into ReadData method to get more than one item?

1 solution

If these data must be from Excel, try ClosedXML to read content from excel.
Otherwise, consider to have it in text file where you can just read it as follow:
string [] data = File.ReadAllLines(<fileName>);
 
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