I am sorry, your code still has a couple of mistakes. I just updated your code, fixed issues and tried with sample test data. Can you try this code.
class Program
{
static void Main(string[] args)
{
var root = new Root
{
results = new List<Result>
{
new Result
{
statement_id = 10,
series = new Series[]
{
new Series
{
name = "some name",
columns = new List<string> { "some column1", "some column2" },
partial = true,
values = new List<List<object>>
{
new List<object> { "some value 1", "some value 2" },
new List<object> { "some value x", "some value y" },
}
}
}
}
}
};
var countColumns = root.results.First().series.First().columns.Count;
var countRows = root.results.First().series.First().values.Count;
var table = new DataTable();
foreach (Result dataloop in root.results)
{
for (int i = 0; i < countColumns; i++)
{
var çolumn = dataloop.series[0].columns[i].ToString();
table.Columns.Add(çolumn);
}
for (int x = 0; x < countRows; x++)
{
DataRow row = table.NewRow();
for (int y = 0; y < countColumns; y++)
{
row[table.Columns[y]] = dataloop.series[0].values[x][y].ToString();
}
table.Rows.Add(row);
}
}
// some helper method to print the data
PrintDataTable(table);
}
}
Output is like this,