嗨,这是我的json文件结构。所以你能告诉我这个json文件的sql表结构吗?

时间:2013-11-08 04:08:08

标签: sql json extjs4

{
"success":true,
"cityList":[
{
"id":3793,
"name":"New York",
"country":"USA",
"district":"New York",
"population":8008278,
"lastYearPopulation":6807036
},
{
"id":3794,
"name":"Los Angeles",
"country":"USA",
"district":"California",
"population":3694820,
"lastYearPopulation":3140597
},
{
"id":3795,
"name":"Chicago",
"country":"USA",
"district":"Illinois",
"population":2896016,
"lastYearPopulation":2461613
},
{
"id":3796,
"name":"Houston",
"country":"USA",
"district":"Texas",
"population":1953631,
"lastYearPopulation":1660586
},
{
"id":3797,
"name":"Philadelphia",
"country":"USA",
"district":"Pennsylvania",
"population":1517550,
"lastYearPopulation":1289917
},
{
"id":3798,
"name":"Phoenix",
"country":"USA",
"district":"Arizona",
"population":1321045,
"lastYearPopulation":1122888
},
{
"id":3799,
"name":"San Diego",
"country":"USA",
"district":"California",
"population":1223400,
"lastYearPopulation":1039890
},
{
"id":3800,
"name":"Dallas",
"country":"USA",
"district":"Texas",
"population":1188580,
"lastYearPopulation":1010293
},
{
"id":3801,
"name":"San Antonio",
"country":"USA",
"district":"Texas",
"population":1144646,
"lastYearPopulation":972949
},
{
"id":3802,
"name":"Detroit",
"country":"USA",
"district":"Michigan",
"population":951270,
"lastYearPopulation":808579
}],
"totalCount":100
}

1 个答案:

答案 0 :(得分:0)

使用Json2csharp找出你的json的类。应该有所帮助 这是你的课程:

public class CityList
{
    public int id { get; set; }
    public string name { get; set; }
    public string country { get; set; }
    public string district { get; set; }
    public int population { get; set; }
    public int lastYearPopulation { get; set; }
}

public class RootObject
{
    public bool success { get; set; }
    public List<CityList> cityList { get; set; }
    public int totalCount { get; set; }
}