I am converting my datatable to c# generic list.
DataTable dt = mydata();
List<DataRow> list = dt.AsEnumerable().ToList();
Now how can i convert this list
to json using json.net? Any suggestion.
Sample of json format should be like this,
{"Table" : [{"userid" : "1","name" : "xavyTechnologies","designation" : "",
"phone" : "9999999999","email" : "[email protected]","role" : "Admin","empId" : "",
"reportingto" : ""},{"userid" : "2","name" : "chendurpandian","designation" :
"softwaredeveloper","phone" : "9566643707","email" : "[email protected]",
"role" : "Super User","empId" : "1","reportingto" : "xavyTechnologies"},
{"userid" : "3","name" : "sabarinathan","designation" : "marketer","phone" :
"66666666666","email" : "[email protected]","role" : "User",
"empId" : "2","reportingto" : "chendurpandian"}]}