I called REST API and was able to put the JSON response received back in a String using:
string vResp = new StreamReader(response.GetResponseStream(), Encoding.Default).ReadToEnd();
Below is the result of vResp from Console.WriteLine
{
"Response" : [ {
"UserID " : "23123213",
"UserName " : "dms"
}, {
"UserID " : "542515",
"UserName " : "ark"
}, {
"UserID " : "56546",
"UserName " : "oneim"
}, {
"UserID " : "33336536",
"UserName " : "cyberx"
}, {
"UserID " : "7563624",
"UserName " : "bt"
}, {
"UserID " : "1221414",
"UserName " : "azure"
} ],
"count" : "6"
}
I want to parse each UserID
and UserName
and insert each record in a table but not able to parse correctly. I tried different codes and I am able to separate Response
and count
but not able to reach one level below. Can anyone please help in this?