G
Guest
Hello,
I need to store various values that I will need to look up later on. I have
been using hashtables and arraylists. But I can only store 2 items per row
in a hashtable - key, value, and only 1 item in an arraylist. Or, I could
create a class with various members and store that in a collection, or a
structure, ...
I was thinking, I could create a datatable and add data to the datatable.
But when I need to retrieve data from this table what is the best way to
search it? Can I use a sqldatareader on a datatable? like (pseudocode)
dim dtr as sqldatareader = "select * from datatable1 where recordID = 100"
Is something like this doable? What is the correct/best way to search a
datatable? I hope it isn't just to loop through all the rows.
Thanks,
Rich
I need to store various values that I will need to look up later on. I have
been using hashtables and arraylists. But I can only store 2 items per row
in a hashtable - key, value, and only 1 item in an arraylist. Or, I could
create a class with various members and store that in a collection, or a
structure, ...
I was thinking, I could create a datatable and add data to the datatable.
But when I need to retrieve data from this table what is the best way to
search it? Can I use a sqldatareader on a datatable? like (pseudocode)
dim dtr as sqldatareader = "select * from datatable1 where recordID = 100"
Is something like this doable? What is the correct/best way to search a
datatable? I hope it isn't just to loop through all the rows.
Thanks,
Rich