From the question it appears that there is a
VariableValue
for each
VariableDescription
in the database, and a particular
VariableValue
is required to be selected from these values for a given
VariableDescription
.
If so, I think a Dictionary with VariableDescription as
key
and VariableValue as
Value
can be populated.
dicVersion.Add(reader["VariableValue"].ToString(),
(reader["VariableDescription"].ToString()));
may be replaced with
dicVersion.Add(reader["VariableDescription"].ToString(),
(reader["VariableValue"].ToString()));
To retrieve the VariableValue corresponding to a given VariableDescription
Dictionary<string,> VariableDictionary = SelectdicVersion();
string myValue = VariableDictionary["myDescription"];