日期:2014-05-18  浏览次数:20843 次

求C# 解析前台传来的json的方法
例如:
{
  "danju":[
{"itemsrc":"购进","happen":"2012-3-12","paymode":"现金","fapiao":"2012456322","shifu":"200","gongying":"诺基亚",passman:"经手人"}
],
"details":[
{"baseid":"12","price":"100","geshu":"2","inroom":"ruku gid","recnum":"20120308-4564","remark":"备注"},{"baseid":"13","price":"10","geshu":"20","inroom":"ruku gid","recnum":"20120308-4565","remark":"备注2"}
]
}

这样一个格式的json,想实现
danju的数据分离出来,对应的插入到sql 数据库,
details 分离出来,有几天,插入几条,我的例子就假设两条。
有什么比较好的方法吗?

------解决方案--------------------
DataContractJsonSerializer
------解决方案--------------------
楼上那个可以