Your problem is that foreach loop for rectangle two dimensional array will return all elements from that array one at a time. You need to use indexes to access rows and columns of a two-dimensional array.
Go through each row and display each element. Then add paragraph (new line) after each row.
Example is given below:
for (int row = 0; row < array_questions.GetLength(0); row++)
{
for (int column = 0; column < array_questions.GetLength(1); column++)
{
//writing data, you probably want to add comma after it
Response.Write(array_questions[row,column]);
}
//adding new line, so that next loop will start from new line
Response.Write(Environment.NewLine);
}
for array of 5 rows and 10 columns of default int values, I've received next table
0000000000
0000000000
0000000000
0000000000
0000000000
If you had correctly populated array_questions before, you should receive table-view data on page, resulted in Response.Write calls.
A much cleaner solution would be to reuse dt (I assume it's a DataTable) Rows property, which is IEnumerable<DataRowCollection>. Next code achieves similar behavior, but in much cleaner fashion, and you don't need another array.
foreach (var row in dt.Rows)
{
Response.Write(string.Join(", ", row) + Environment.NewLine);
}
will print data in next table-like fashion:
0, 0, 0, 0, 0, 0, 0, 0, 0, 0
0, 0, 0, 0, 0, 0, 0, 0, 0, 0
0, 0, 0, 0, 0, 0, 0, 0, 0, 0
0, 0, 0, 0, 0, 0, 0, 0, 0, 0
0, 0, 0, 0, 0, 0, 0, 0, 0, 0