I need to create container like this: Container.Add(RowIndex, ValueIndex);
I know Dictionary just have Key and Value and this is not good for me.
And i havent no idea how to use 2 containers to create Row, Index how i want.
So example:
Container[Row][Index]:
Container[0][0] = "Apple";
Container[0][1] = "Orange";
Container[1][0] = "Number";
Because im trying use this container for read sql. When i got next result it add to current row value +1. And Index mean field value.
In code:
int row = 0;
while (ObjReader.Read())
{
foreach (var result in ObjReader)
ReadList.Add(row, result.ToString());
row++;
}
ObjReader.NextResult();
this is for reading
and now get result to another Class
public string Field(int row, int index)
{
return ReadList[row][index];
}
It seems you’re looking for a
ListofLists.Now you can do something like:
results[2][1]to get the value at the 3rd row in the 2nd column.