I have 2 datasets. One dataset is called Grid and the other is Coords.
I want to do a
For Each CurrentRecord As Datarow in Coords
In this For Loop I want to subtract each CurrentRecord Value from each CurrentRecord value in Grids and out put them to an array
So now I should have seperate arrays for each CurrentRecord value.
ie example data/database setup
Coords Table
Record | X1 = 5
Record | X2 = 3
Record | X3 = 5
Record | X4 = 10
Grid Table
Record | A = 1
Record | B = 2
Record | C =3
Record | D = 4
The out put after running the For Loop should be to this effect
Array 1
X1

X1

X1

X1

Array 2
X2

X2

X2

X2

Array 3
X3

X3

X3

X3

Array 4
X4

X4

X4

X4

Okay now that we have the data in an array I would like to run a IF Then statement (maybe) to find out which number is the lowest in each array
Array 1
X1

Array 2
X2

Array 3
X3

Array 4
X4

In this sample data all the arrays point to Grid D (this is only sample data and will not the the typical outcome).
I want to either create a new array or dumb this into a new database table/xml file that X1 is D, X2 is D, X3 is D, X4 is D.
I'll also do this for Y and Z, but they will be seperate in data.
Anyone willing to help me get started with this
Thanks