Click here to Skip to main content
15,919,613 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I would like to create a list of sorts, but it will have at least 6 columns and at least 50 rows. I want to be able to look up a row based on data in any column and extract information from any column in that identified row. I am learning C# and trying to apply some stuff I have picked up. However, I'm not sure about this wish. Can I do it? Any help will be appreciated as I try to develop this skill.
Posted
Comments
Rajesh Sajjanar 7-Aug-10 14:37pm    
Hi Can you please provide some more details, so that we can help you
BigDoggit 7-Aug-10 22:49pm    
I'm sorry, I accidentally added an answer - here is the comment,

I'm not sure what I should provide. Could you ask some questions so I know what other information would be helpful? My request above will be working with strings and doubles, but I wouldn't mind implementing it as a generic so it could be usable for any data types. Even better if it could hold variable columns or rows depending on how the class would be initialized. I want this to be standalone and have my other classes or methods call on it. Does that help at all? Definitely not trying to be difficult in case I sound like I am. I appreciate the help.

1 solution

It sounds to me like you want to create a struct to store your data, create a list of that struct, and write code that searches all the values in your struct to find a match.
 
Share this answer
 
Comments
BigDoggit 8-Aug-10 23:36pm    
I can see now something I should have said. My apologies - I'm learning just by asking. I want this data to be related like a database table where one row's data is all linked. This way I can have a list and then search for a specific value. The method can then return answers from the same row, depending out what the user is requesting. That probably helps more. Once again, sorry for leaving that out. Is a struct still helpful? Maybe something else?

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