Hi all,
I just try to input integer typed table rows into 2D integer array. I've tried the code below but it outputs me only last row :(
Input Table :
-----------------------
id red green blue
1101 12 11 13
1102 12 12 14
1103 13 14 13
------------------------
2D Array : array<Int32,2> ^y_k = gcnew array<Int32,2>(5,4);
// INPUT TABLE ROWS INTO 2D ARRAY
while (reader->Read())
{
//for(int i=1; i<2; i++)
for(int i=1; i<4; i++)
{
y_k[i,1] = Convert::ToInt32( reader["id"] );
y_k[i,2] = Convert::ToInt32( reader["red"] );
y_k[i,3] = Convert::ToInt32( reader["gren"] );
y_k[i,4] = Convert::ToInt32( reader["blue"] );
}
}
// CHECKING ARRAY INPUT
for(int j=1; j<4; j++) //column
{
for(int i=1; i<5; i++) // row
{ textBox1->AppendText(Convert::ToString(y_k[i,j])) ;
textBox1->AppendText(" ");
}
textBox1->AppendText("||");
}