I’ve got a DB table with three fields, Category, Name, and value (string, string, int). Category and Name together are the primary key. My intent now is to write a method to return the contents of this table sorted into a
List<List<string>>
where each List is a list of entries with the same category (and the first string is the category). How can I do this, or am I going about this the wrong way?
EDIT: The reason I’ve chose this data type is that I will be filling HTML tables with the data, and would just like to iterate with nested foreach loops.
foreach(List<string ls in List<List<string>>)
use a foreach(string) to generate a table for ls
I have a feeling you are going about this the wrong way. I would create a simple class
and manage
List<Item>instead.