I have a table full of id’s,categories and weights that I need to reference in my program as I read in records that contain those categories. What is the most efficient method to read those from a database and put into a structure that I can reference?
The ID’s (and possibly the names) would be unique
Data might look like:
ID,Category,Weight 1,Assignment,5 2,Test,10 3,Quiz,5 4,Review,3
Your best bet is to read in your table using a DataReader, and put each row into an object containing Category and Weight, then each object into a Dictionary.