Hi Josema,
Is your size of array constant, or any of it's length?
If HEIGHT is constant:
object[,] yourArray;
DataRowCollection yourRows; // your DataTable's rows (eg. ID, VALUE)
int newId;
object[] itemArray=new object[2];
for(y=0; y<HEIGHT; y++) {
for(x=0; x<width; x++) {
newId=(y*HEIGHT)+x;
itemArray[0]=newId;
itemArray[1]=yourArray[y,x];
yourRows.Add(itemArray);
}
}
HTH
Marcin
PS: The Simplest, You can save values with (X, Y) as a DataTable
indices.
Hi,
I would like to know how fill a datatable from a two dimensional array.
Any advice will be grateful.