Hi Guy's,
I am not sure if I am heading in the right direction with a task I have to complete and I have no one at work to ask.
The task involves opening an excel spread sheet grabbing two columns of data, three if possible.
Then retrieving the data to use like a look up. What is the best way to do this.
Two / three dimensional arrays, dictionary?
If I use the code below. How do I get the second element based on the value of the first element.
Where first element value = three, give me associated second element value (four)
Thanks,
I am not sure if I am heading in the right direction with a task I have to complete and I have no one at work to ask.
The task involves opening an excel spread sheet grabbing two columns of data, three if possible.
Then retrieving the data to use like a look up. What is the best way to do this.
Two / three dimensional arrays, dictionary?
If I use the code below. How do I get the second element based on the value of the first element.
Where first element value = three, give me associated second element value (four)
Thanks,
C#:
string[,] array2Db = new string[3, 2] { { "one", "two" }, { "three", "four" },
{ "five", "six" } };
MessageBox.Show(array2Db[0, 0]);
MessageBox.Show(array2Db[0, 1]);
MessageBox.Show(array2Db[1, 0]);
MessageBox.Show(array2Db[1, 1]);
MessageBox.Show(array2Db[2, 0]);
MessageBox.Show(array2Db[2, 1]);
Last edited: