How to populate a repeater with two separate list
I have the following repeater:
Each row contains individual columns. You can access it through Rows[i].ItemArray
Your DataTable
could to be accessed in the form of array of muti-dimension
, besides being the most briefly to access rows and columns. For example:
myDt.Rows[0][0]; // access the first row and first column
myDt.Rows[0][1]; // access the first row and second column
myDt.Rows[0][2]; // access the first row and third column
myDt.Rows[1][0]; // access the second row and first column
myDt.Rows[1][1]; // access the second row and second column
myDt.Rows[1][2]; // access the second row and third column
If you need can go all fields returned using two nested for
statement:
for(int i = 0;i < dtData.Rows.Count;i++)//travels the rows
{
for(int j = 0;j < dtData.Rows.Count;j++)//travels the columns
{
var valueField = myDt.Rows[i][j];//access the value of current field
}
}