0
Answer

Dynamic variable names or something else??

Dave Regan

Dave Regan

16y
1.9k
1
I have a MSSQL database that is interfaced through Linq and one of the tables is normalized strangely (it's a client's database and can't be helped). it is a table with a list of values accessed like so:

Table._1
Table._2
Table._3
....
Table._43
Table.foreign_key

I'd like to access all of the _ fields in a for or foreach loop, is there anyway to do this??

for (int i; i<43; i++)
{
echo Table._[i].ToString();
}

Above is what I would like to do, but of course it doesn't work. So, the Table object is just a class with a bunch of doubles, I need a way to iterate through each one.

Thanks, Dave