C# JSON字符串转datatable【简单一级json字符串】

 /// 
        /// 简单json转datatable数据集
        /// 
        /// 
        /// 
        public static DataTable JsonToDataTable(string json)
        {
            try
            {
                JArray ay = JArray.Parse(json);
                DataTable db = new DataTable();     
                db = JsonConvert.DeserializeObject<DataTable>(ay.ToString());
                return db;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

你可能感兴趣的:(c#,json,java)