I am working with JSON.
when I am Passing data for serialization at that time I am getting error which is given below..
‘cannot be accessed with an instance reference; qualify it with a type name instead’. and ‘Exception of type ‘System.OutOfMemoryException’ was thrown.’
My Code is
List<UserMaster> us = objusers.SelectAll().ToList();
Paging<UserMaster> users = UserMaster.SelectUserFilter(start, limit, query,ref us);
context.Response.Write(string.Format("{{total:{1},'users':{0}}}", JSON.Serialize(users.Data), users.TotalRecords));
Many JSON serializers are not very robust and cannot handle all cases.
If your JSON is well-formed, surely the JSON.NET (free) library can handle it. Check it out at http://james.newtonking.com/pages/json-net.aspx.
Good luck!