Looks like the
JavaScriptSerializer
doesn't support deserializing to a
dynamic
object. If you look at the type of your
drecord
variable, you'll see that it's a
Dictionary<string, object>
, which doesn't support dynamic access.
You'll need to use indexers to access the properties:
dynamic drecord = jss.Deserialize<dynamic>(data);
string entityList = drecord["data1"]["EntityList"];
string keyName = drecord["data1"]["KeyName"];