使用说明:
    对List<类> 集合使用的方法:
     List<TBL_CODE_MZ> objList = objAction.GetCODE_MByList(objTbl);
     string JsonSource = JSONHelper.ToJSON(objList); //当前页记录转成JSON格式
     但有个问题:
     日期型数据谁转换成:@123456789@这样的数据!???不知道谁碰到过没有!!!!

  对数据集的使用如:DataSet,DataTable
 

 

C#生成JSON数据格式的函数JSONHelper jsonHelp = new JSONHelper();
C#生成JSON数据格式的函数
C#生成JSON数据格式的函数            jsonHelp.success 
= true;
C#生成JSON数据格式的函数            jsonHelp.totlalCount 
= getPrjListCount();
C#生成JSON数据格式的函数            
C#生成JSON数据格式的函数            
foreach (DataRow dr in dsResult.Tables[0].Rows)
 jsonHelp.ToString();

 

//######################JSONHelp.cs源码######################################//

 

C#生成JSON数据格式的函数using System;
C#生成JSON数据格式的函数
using System.Collections;
C#生成JSON数据格式的函数
using System.Collections.Generic; 
C#生成JSON数据格式的函数
using System.Text; 
C#生成JSON数据格式的函数
using System.Web.Script.Serialization;
C#生成JSON数据格式的函数
C#生成JSON数据格式的函数
namespace framework.common
}
http://blog.csdn.net/LGame/archive/2008/01/09/2031303.aspx

相关文章: