Dim dt As DataTable = DataTables("报价") Dim s As String = JsonConvert.SerializeObject(dt.BaseTable) Output.Show(s)
例如,删掉那个3个多余的System_xxx字段,代码如下
Dim dt As DataTable = DataTables("temu与tk风格转换") Dim s As String = JsonConvert.SerializeObject(dt.BaseTable) Dim ja As JArray = JArray.Parse(s) For Each jo As JObject In ja jo.Remove("System_Sort_Temporary") jo.Remove("System_Filter_Temporary") jo.Remove("System_Filter_Unique") Next Output.Show(ja.ToString)
Dim dtCopy As System.Data.DataTable = DataTables("报价").BaseTable.Copy dtCopy.Columns.Remove("System_Sort_Temporary") dtCopy.Columns.Remove("System_Filter_Temporary") dtCopy.Columns.Remove("System_Filter_Unique") Dim s As String = JsonConvert.SerializeObject(dtCopy)