D
Doug
I have data that looks something like this when returned from a stored
procedure (3 columns, X rows):
Key1 Name1 Value1
Key1 Name2 Value2
Key1 Name3 Value3
Key1 Name4 Value4
Key2 Name1 Value1
Key2 Name2 Value2
Key3 Name1 Value1
KeyX NameY ValueY
Data type for all is string.
Number of rows returned from sp will never exceed 100.
You can see that there is a conceptual 1:many relationship between Keys and
Names; and a 1:1 relationship between Names and Values.
Order for Key, Name, or Value is unimportant to my application logic - so
could be returned from db sorted by alpha if necessary.
My application logic needs to (1) quickly find all of the Name/Value pairs
for a given key; and (2) update specific Value values (sorry!). Eventually
all the updated Value values will be written back to the database (i.e.,
Keys and Names will never be updated) The application logic will never add
or remove Keys, Names, or Values. We're only reading lists of Name/Value
pairs, and updating Value values.
I would prefer to *not* store this in an in-memory ADO.NET DataTable for
performance and size reasons.
I'm thinking a 3-dimensional array might give me best performance - but I
don't know the syntax required to populate it or to retrieve and update its
data. I could look it up, but don't know if doing that would yield the best
performance.
Recommendations? Suggestions? (syntax examples, if possible, would be very
much appreciated).
Thank You!
procedure (3 columns, X rows):
Key1 Name1 Value1
Key1 Name2 Value2
Key1 Name3 Value3
Key1 Name4 Value4
Key2 Name1 Value1
Key2 Name2 Value2
Key3 Name1 Value1
KeyX NameY ValueY
Data type for all is string.
Number of rows returned from sp will never exceed 100.
You can see that there is a conceptual 1:many relationship between Keys and
Names; and a 1:1 relationship between Names and Values.
Order for Key, Name, or Value is unimportant to my application logic - so
could be returned from db sorted by alpha if necessary.
My application logic needs to (1) quickly find all of the Name/Value pairs
for a given key; and (2) update specific Value values (sorry!). Eventually
all the updated Value values will be written back to the database (i.e.,
Keys and Names will never be updated) The application logic will never add
or remove Keys, Names, or Values. We're only reading lists of Name/Value
pairs, and updating Value values.
I would prefer to *not* store this in an in-memory ADO.NET DataTable for
performance and size reasons.
I'm thinking a 3-dimensional array might give me best performance - but I
don't know the syntax required to populate it or to retrieve and update its
data. I could look it up, but don't know if doing that would yield the best
performance.
Recommendations? Suggestions? (syntax examples, if possible, would be very
much appreciated).
Thank You!