Convert a data row to a JSON object

后端 未结 4 1720
天涯浪人
天涯浪人 2020-12-11 16:08

I have a DataTable which has only a single row and looks like

   America              |  Africa               |     Japan     |   
   ----------         


        
4条回答
  •  盖世英雄少女心
    2020-12-11 16:51

    Spelling? Shouldn't your call to the "SerializeObject" method be:

    string js = JsonConvert.SerializeObject(datatable);
    

    Also see a similar question on converting a datatable to JSON string.

提交回复
热议问题