How to create datatable from Json object?

Hi @Yoichi,

I referred your solution in below post:

My json text is as below:
{
“SitLib”: [
{
“Sites”: “https://site1”,
“Libraries”: “BG,HRM”
},
{
“Sites”: “https://csite2”,
“Libraries”: “SD”
}
]
}

And I have modified the invoke code you shared like below:
System.Data.DataRow row;
foreach (System.Text.RegularExpressions.Match m in matches){
row=dt.NewRow();
row[“Sites”]=m.Groups[1].Value;
row[“Libraries”]=m.Groups[2].Value;
dt.Rows.Add(row);
}

And match regex as below:
“Sites”“\s*:\s*”“([^”“]+)”“,\s+”“Libraries”“\s*:\s*”“([^”“]+)”“”

But looks like I am missing something here, getting below error:
RemoteException wrapping System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. —> RemoteException wrapping System.ArgumentException: Column ‘Sites’ does not belong to table TableName.
at System.Data.DataRow.GetDataColumn(String columnName)

Could you please help identify the issue?

Regards
Sonali