我将我的datatable转换为c#通用列表。
@H_404_10@DataTable dt = mydata(); List<DataRow> list = dt.AsEnumerable().ToList();
现在我如何使用json.net将此列表转换为json?任何建议。
json格式的样本应该是这样的,
{"Table" : [{"userid" : "1","name" : "xavyTechnologies","designation" : "","phone" : "9999999999","email" : "test@test.com","role" : "Admin","empId" : "","reportingto" : ""},{"userid" : "2","name" : "chendurpandian","designation" : "softwaredeveloper","phone" : "9566643707","email" : "chendur.pandia@gmail.com","role" : "Super User","empId" : "1","reportingto" : "xavyTechnologies"},{"userid" : "3","name" : "sabarinathan","designation" : "marketer","phone" : "66666666666","email" : "bala3569@gmail.com","role" : "User","empId" : "2","reportingto" : "chendurpandian"}]}