首先要知道其拼接出来JSON串格式为:
[{"id":1,"name":"C","size":"","date":"02/19/2010","children":[{"id":2,"name":"Program Files","size":"120 MB","date":"03/20/2010","children":[{"id":21,"name":"Java","size":"","date":"01/13/2010","state":"closed"}]}]}]
我成功表结构和数据为:
1 xx xxx 0 NULL NULL NULL
2 xx1 xxx 1 1 NULL NULL
3 xx2 xxx 1 2 NULL NULL
4 xx12 xxx 2 32 NULL NULL
5 xx22 xxx 2 12 NULL NULL
6 xxx xxx 2 54 NULL NULL
7 xxx1 xxx 2 5 NULL NULL
8 xx2x xxx 2 2 NULL NULL
9 xx12x xxx 2 58 NULL NULL
10 xx22x xxx 2 55 NULL NULL
USE [xxx]
GO
/****** 对象: Table [dbo].[uitree] 脚本日期: 11/08/2018 08:12:52 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[uitree](
[id] [tinyint] IDENTITY(1,1) NOT NULL,
[textd] [nvarchar](50) NULL,
[decb] [nvarchar](50) NULL,
[pid] [tinyint] NOT NULL,
[te1] [nchar](10) NULL,
[te2] [nchar](10) NULL,
[te3] [nchar](10) NULL
) ON [PRIMARY]
达到的效果图为:
详细各层源码:
https://download.csdn.net/download/sadleaflzh/10771620